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 close allies stressed the need for continued close co-operation between their countries, as well as between the US and the European Union.
And they praised each other's leadership, with Mr Obama paying tribute to Mrs Merkel's "core values, integrity, truthfulness, thoughtfulness".
Mr Obama said he hoped Mr Trump would seek a constructive relationship with Russia, "finding areas where we can co-operate with Russia where our values and interests collide".
But he also said he hoped Mr Trump "is willing to stand up to Russia when they deviate from our values and international norms.
"I don't expect the president-elect will follow exactly our approach, but my hope is that he does not simply take a realpolitik approach and suggest if we cut some deals with Russia - even if it hurts people or violates international norms, or leaves smaller countries vulnerable, or leaves long-term problems in regions like Syria - that we do what's convenient at the time."
Why Germans will miss Obama: By Jenny Hill, BBC Berlin correspondent
When Barack Obama came to Berlin in 2008 he was greeted like a rock star.
Hundreds of thousands of cheering Germans turned out for the then presidential candidate and roared their approval of his vision of a new America - one which would be open to, and co-operate with, the rest of the world. His liberal and diplomatic tone struck a chord with many in the excited crowd.
Few here are cheering now.
Before he arrived in Berlin, Mr Obama and Mrs Merkel wrote a joint piece in which they strongly defended globalisation.
In an article in business magazine Wirtschaftswoche (in German), they voiced their support for the proposed Transatlantic Trade and Investment Partnership (TTIP) between the US and the EU - something Mr Trump is fiercely critical of.
"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."
The two leaders said they had discussed the crises in Ukraine and Syria, the fight against so-called Islamic State and transatlantic trade during Thursday's meeting.
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.
'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."