The Stone Cross was placed by the Portuguese in 1486 and features the country's crest
The Stone Cross is a Portuguese navigation landmark placed on the southwest African coastline in 1486.
But when the area was under German colonial control in the 1890s, the cross was taken and moved to Europe.
Namibia asked for its return in 2017 and on Friday, the Berlin museum formally agreed to the request.
Germany has pledged to return artefacts and human remains to its former colonies.
At a ceremony, German Culture Minister Monika Grütters said it was a "clear signal that we are committed to coming to terms with our colonial past".
Namibia's ambassador to Germany, Andreas Guibeb, called it "important as a step for us to reconcile with our colonial past and the trail of humiliation and systematic injustice that it left behind".
A museum press release said the cross would be returned in August.
Namibia's Ambassador to Germany Andreas Guibeb attended the event on Friday
Portuguese explorer Diogo Cão first placed the 3.5m (11ft) stone cross - featuring the country's coat of arms - on Africa's southwest coast during one of his expeditions.
It became so well known it featured on old maps of the area.
But a German naval commander took the cross in 1893, during the country's control of what became Namibia between 1884 and 1915.
The German Historical Museum foundation's president, Raphael Gross, wrote in the Frankfurter Allgemeine Zeitung that the cross represented "the slow beginning of colonial rule in present-day Namibia".
A number of African nations have in recent years called on European museums to return artefacts taken away during the period of colonial control.
Experts recommended that French museums return African treasures to their countries of origin last year. President Emmanuel Macron announced 26 thrones and statues taken from Benin would go home shortly afterwards.
UK museums have also decided to repatriate artefacts to African countries.
The National Army Museum announced it would return a lock of Ethiopian Emperor Tewodros II's hair in March, while the Victoria and Albert Museum offered to return Ethiopian treasures in November - albeit on loan.