Security was tight in front of the German capital's iconic Brandenburg Gate, where Obama and Merkel appeared on a podium before thousands of people attending a gathering marking the 500th anniversary of the Protestant Reformation.
Police helicopters patrolled the skies and snipers with balaclavas watched the scene from nearby rooftops.
After lauding Merkel as someone who had done "outstanding work," Obama launched a defense of his own presidency and the values of liberal democracy championed by both leaders.
In a veiled reference to his successor Donald Trump, Obama also spoke of the need to see development aid and diplomacy as essential aspects of national security policy.
Also Read
"We can't isolate ourselves. We can't hide behind a wall," he said, to cheers from the audience.
Merkel, who hosted Obama at the same spot four years ago, was due to travel to Brussels later Thursday for a meeting with leaders of fellow NATO member states, including President Trump.
Disclaimer: No Business Standard Journalist was involved in creation of this content