TEHRAN (Press Shia) – US President Barack Obama and European leaders pledged Friday to maintain NATO cooperation, and vowed to keep up sanctions against Russia, in their first meeting since the shock election of Donald Trump sparked fears of drastic policy shifts.

During a fractious presidential campaign, Trump had appeared to call into question a near 70-year-old security shield for US allies under NATO, and vowed to withdraw from hard-fought deals on the climate and Iran's nuclear programme.

The US president-elect's friendly disposition towards Russian President Vladimir Putin has also raised questions over his attitude toward Moscow's backing for President Bashar al-Assad in the Syrian war as well as Russia's role in the conflict in eastern Ukraine.

In the talks in Berlin during which jittery European partners sought reassurances from Obama, the six parties "agreed on the necessity of working collectively to move the transatlantic agenda forward", according to a statement from the White House, AFP reported.

That meant "securing diplomatic resolution to the conflicts in Syria and eastern Ukraine", including putting the heat on Russia through sanctions until it met its commitments under a peace deal for Ukraine.

The leaders also affirmed the "importance of continued cooperation through multilateral institutions, including NATO".

Ahead of Friday's huddle in Berlin, Obama sounded a note of cautious optimism that Trump could change his position once he takes on the role as president.

"There's something about the solemn responsibilities of that office … that forces you to focus, that demands seriousness," Obama said at a press conference after talks with his host German Chancellor Angela Merkel.

"And if you're not serious about the job, then you probably won't be there very long. Because it will expose problems."

But Obama also stressed the importance of a united Europe, and urged the bloc not to take for granted the transatlantic relationship that has been built up over decades.

"The EU remains one of the world's great political and economic achievements, and those achievements should not be taken for granted," he said.

Friday's meeting between Obama and the leaders of Britain, France, Germany, Italy and Spain is the first of its format since Trump's election.

It opened with the burning question of the US-led coalition's battle against Daesh (also ISIL) in Syria and Iraq as well as Europe's migrant crisis, before delving into the Ukraine crisis, said an aide of Hollande about the talks that lasted just over two hours.

Citing both conflicts, Obama stressed on the eve of the meeting that he hoped Trump would be "willing to stand up to Russia where they are deviating from our values and international norms".

He said Russia was a military superpower with "influence around the world" but cautioned Trump against the temptation to "cut some deals with Russia" that hurt smaller countries because it may seem "convenient at the time."

But Obama's farewell visit also come as the EU faces unprecedented challenges that threatened to rip it apart.

British Prime Minister Theresa May, whose country shocked the world when it voted to quit the EU, is due to hold separate talks over the issue on the sidelines with Merkel.

France's President Francois Hollande is grappling with record low approval ratings ahead of next May's election that could see far-right Marine Le Pen reaching the second round run-off vote, or even winning outright.

And Italy's Matteo Renzi, and Spain's Mariano Rajoy are battling state debt woes.

But Obama urged the parties to focus on the whole, noting that "the achievements that we have seen on this continent in contrast to a divided Europe of the previous century, are ones that remind us of how important it is that we work together."

Ahead of potentially bitter negotiations within the European Union over Brexit, Obama called on Brussels and London to work towards a future relationship that "preserve as closely as possible the economic and political and security relationships between the UK and EU".

Obama's choice of Berlin as the stop for his European farewell tour has been interpreted by some observers as the passing of baton of the defence of liberal democracy to Merkel.

In a departure for the leader of a country that once took lessons from the United States on basic freedoms, Merkel's congratulatory message to Trump tied future cooperation with common democratic values.

Giving a ringing endorsement for Merkel before she announces if she will run for a fourth term in next year's elections, Obama acknowledged that she would have heavy international burdens to shoulder.

"I wish I could be there to lighten her load somewhat. But she's tough," said Obama, in his sixth official visit to Germany, before heading off to Lima for a summit of Asia-Pacific leaders.

A day after Obama's praise for Merkel, her party announced a surprise press conference on Sunday in what is widely believed to be the occasion for the German leader to declare for a fourth term.