President Barack Obama spent Friday doing a first round of bidding for his successor, pleading with European leaders to work with president-elect Donald Trump once he assumes office.

It’s a strange situation for all parties. During the election campaign, Obama and many of these leaders did not mince words about their distaste for Trump. The president-elect’s plans for U.S.-European cooperation ― including the U.S. role in the North Atlantic Treaty Organization, Russia’s activity in Ukraine and the campaign against the so-called Islamic State ― remain totally uncertain.

Not to mention that many Europeans are particularly wary of Trump as they watch extreme-right leaders across their own continent lavish praise on him.

In a meeting Friday with the leaders of Great Britan, France, Italy and Spain, Obama urged his counterparts to work with Trump on the “basis of the core values that define the United States and Europe as open democracies,” according to the White House.

That’s a 180-degree shift from Obama’s overwhelmingly negative portrayal of the GOP nominee until only a few weeks ago, when he slammed Trump’s behavior as “dark, pessimistic fear-mongering.”

Nonetheless, Obama has also used his world tour to offer Trump advice.

“My hope is that the president-elect coming in takes a similarly constructive approach of finding areas where we cooperate with Russia, where our values and interests align, but that the president-elect is also willing to stand up to Russia where they are deviating from our values and international norms,” Obama said Thursday, taking a subtle stab at Trump’s calls for a rapprochement with Russia.

He also warned that leading a country “demands seriousness.”

“If you’re not serious about the job, then you probably won’t be there very long,” he said.

Florian Gaertner via Getty Images Obama first spoke in Berlin during his presidential run in 2008.

Leaders across Europe responded to Trump’s shocking election victory with muted respect, even though many have criticized him in the past.

Merkel said Thursday that she plans to approach his presidency “with an open mind.” But just last week she issued a veiled criticism, saying that their relationship would only be productive if Trump upheld “the dignity of man, independent of origin.”

Trump touted the idea of banning Muslims from the U.S. throughout his campaign; now, his transition team has floated the idea of forcing Muslims to register.

Obama and Merkel developed an especially close relationship in the last eight years, despite a few hiccups ― in particular, the revelation that the National Security Agency had been tapping Merkel’s phone.

They wistfully said farewell on Thursday during a joint news conference. Obama referred to Merkel as an “outstanding partner” and thanked her for her “deep friendship.” He even said he would vote for her if he could.

“It is hard to say goodbye,” Merkel said.