The German president has expressed "shame" for the colonial atrocities his country inflicted on Tanzania.
German forces killed almost 300,000 people during the Maji Maji rebellion in the early 1900s, one of the bloodiest anti-colonial uprisings.
President Frank-Walter Steinmeier was speaking at a museum in Songea, where the uprising took place.
"I would like to ask for forgiveness for what Germans did to your ancestors here," he said.
"What happened here is our shared history, the history of your ancestors and the history of our ancestors in Germany."
The Maji Maji rebellion was triggered by a German policy designed to force the indigenous population to grow cotton for export.
Tanzania was a part of German East Africa, which consisted of modern-day Rwanda, Burundi and parts of Mozambique.
President Steinmeier said he hoped Tanzania and Germany could work towards "communal processing" of the past.
He promised to "take these stories with me to Germany, so that more people in my country will know about them."
Germany has, until recently, had "colonial amnesia", according to Jürgen Zimmerer, a history professor at the University of Hamburg.
"The brutality and the racism of this colonial empire was not understood in the German public."
As part of the three-day visit, the president met the descendants of one of the Maji Maji leaders, Chief Songea Mbano, who was among those executed in 1906.
He is now considered a national hero in Tanzania and President Steinmeier told the family the German authorities would try to find his remains.
Thousands of human remains were brought from German colonies - partly as "trophies" but also for racist research.
Prof Zimmerer said there was "almost no funding" available to identify where these bones and skulls, which lie in various museums or institutions, actually came from.
Some of the descendants of those killed have managed to locate them with the help of DNA tests.
On Tuesday, after meeting President Samia Suluhu Hassan in Dar es Salaam, he promised that Germany would co-operate with Tanzania for the "repatriation of cultural property".
Tanzania historian Mohamed Said welcomed the president's apology but told the BBC it did not go far enough.
"They decided to set farms on fire so people would run out of food and be unable to fight. This is unacceptable, in today's world they would be taken to court," he said.
In 2021, Germany officially acknowledged committing genocide during its occupation of Namibia and announced financial aid worth more than €1.1bn (£940m; $1.34bn).
The statements from Germany's president comes after King Charles acknowledged the "abhorrent and unjustifiable acts of violence committed against Kenyans" during their independence struggle, while on a visit to Nairobi.
However, the British monarch did not deliver a formal apology which would have to be decided by government ministers.
Latest Stories
-
CEO of Agblor Lodge commended for coastal protection efforts
3 mins -
Complicated media landscape changes the dynamics of election coverage – Gyan-Apenteng
15 mins -
2024 polls: We need to deal with the political capture of the media landscape – Suzanne Nti
35 mins -
StanChat launches Cohort 4 of Women in Tech incubator with Ashesi’s GCIC
44 mins -
GES gets clearance to recruit 2022 batch of Degree Holders from Colleges of Education
59 mins -
Don’t use missing BVR kits in voter registration; we’ve got their serial numbers – Kofi Adams to EC
1 hour -
Speaker recalls Parliament for emergency sitting on May 17 after Majority’s petition
1 hour -
Prof Gadzekpo reminds journalists of their independent observer role in elections
1 hour -
2 dead, 5 hospitalised in Spintex gas explosion
2 hours -
We can all help improve the media’s credibility – Audrey Gadzekpo
2 hours -
2024 polls: Don’t add up to mistrust in state institutions – Sheikh Aremeyaw to media
2 hours -
Ghana backs Palestine’s bid for full United Nations membership
3 hours -
Prempeh I International Airport will open the Ashanti Region for trade and investment – Ahiagbah
3 hours -
Election 2024: The media should set the right agenda – Prof Audrey Gadzkpo
3 hours -
GRA/SML contract: Respect presidency’s decision to withold full KPMG report – Deputy AG
4 hours