Trump election: Obama urges Trump to stand up to Russia
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 would "not simply take a realpolitik approach" to dealing with Russia.
He also warned against a cyber arms race, saying there was clear proof Russia had engaged in cyber attacks.
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 EU as a whole.
Mrs Merkel acknowledged that the US had "shouldered most of the burden" of the Nato alliance - a disparity criticised by Donald Trump - and said European countries "must in future... engage more, so that in the long term the imbalance in defence spending is eradicated".
Mr Obama said he hoped Mr Trump would seek a constructive relationship with Russia, "finding areas... where our values and interests align".
But he added that he hoped Mr Trump was "willing to stand up to Russia when they deviate from our values and international norms".
This meant, he said, refraining from taking a "realpolitik approach" and cutting deals that could "hurt people or... violate international norms... leave smaller countries vulnerable, or create long-term problems in regions like Syria".
On the issue of cyber attacks, Mr Obama said there was a difference between "Russian intelligence-gathering" and "meddling with elections or going after private organisations or commercial entities".
He said he had "delivered a clear and forceful message that.... we're monitoring it carefully and we will respond appropriately if and when we see this happening".
He also had this warning for young people: "Do not take for granted our systems of government and our way of life... Democracy is hard work."
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.
Mr Obama and Mrs Merkel have had a close working partnership over the last eight years and had warm words for each other. She told reporters "the parting is hard for me", while he called her an "outstanding partner".
Germans are due to go to the polls in the autumn of next year after three consecutive terms in office for Mrs Merkel.
While she has not yet decided whether to stand again, Mr Obama told voters he had appreciated her "integrity, her truthfulness, her thoughtfulness."
During Thursday's talks, the two leaders also discussed the crises in Ukraine and Syria and the fight against so-called Islamic State.
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 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."