US President Barack Obama has urged his successor Donald Trump to stand up to Russia if it deviates from US "values and international norms".
Speaking in Berlin, Mr Obama said he hoped the US president-elect "does not simply take a realpolitik approach" to dealing with Russia.
But he said he was encouraged by Mr Trump's insistence he will remain fully committed to the Nato alliance.
Mr Obama was speaking after talks with the German Chancellor Angela Merkel.
The two allies stressed the need for continued close co-operation between their two countries, as well as between the US and the European Union.
They had earlier issued a joint statement strongly defending globalisation.
Mr Obama is expected to hold talks with UK Prime Minister Theresa May and the leaders of France, Italy and Spain on Friday, before flying to Peru.
Mr Obama and Mrs Merkel said they discussed the crises in Ukraine and Syria, the fight against so-called Islamic State and transatlantic trade, as well as the outcome of the US election.
The two leaders have forged a strong partnership over the years, even surviving the revelation that American spies had listened to her mobile phone calls.
In an article in business magazine Wirtschaftswoche, the two leaders voiced their support for the proposed Transatlantic Trade and Investment Partnership (TTIP) between the US and the EU.
By contrast, Mr Trump is a fierce critic of global free trade agreements and welcomed the UK's decision in June to leave the EU.
"There will be no return to a world before globalisation," Mr Obama and Mrs Merkel wrote.
"We owe it to our companies and our citizens, indeed to the entire world community, to broaden and deepen our co-operation."
'Love is flying out of a window': German media's reaction
German media have adopted an elegiac tone in their coverage of Mr Obama's visit, noting that the close relationship between the outgoing US president and the German chancellor is unlikely to be repeated with Mr Obama's successor.
Focus Online says these are "gloomy days" for Mrs Merkel, as this is "the last time that she will have Barack Obama at her side as president of the United States. It is doubtful that the chancellor will be able to forge a similarly close relationship with Obama's successor Donald Trump".
Several outlets describe the visit as the final flowering of a political love affair that was at first slow to get going.
Typical of these is Zeit Online, which carries the headline "Merkel and Obama: Late Love" and says: "This is the story of a rapprochement between two opposing politicians. And of how they were finally able to get together. The crucial factor was their shared liberal view of the world."
And in the tabloid Bild, columnist Franz Josef Wagner addresses an open letter to Mr Obama in which he writes: "Saying goodbye is difficult for me. It's as if love is flying out of a window, like a butterfly. After Obama we have Trump, and I am closing the window."