President Obama has encouraged the leaders of European countries to remain open to working with the next administration, particularly on matters involving international security and economic policy, the White House said Friday.

Obama's face-to-face meeting with the leaders of Britain, Germany, France, Italy and Spain will likely be his last of the sort before he leaves office. The president met privately with German Chancellor Angela Merkel on Thursday and with Greek Prime Minister Alexis Tsipras in Athens on Tuesday.

The White House said Obama expressed gratitude for the willingness among his counterparts to work with him while in office to strengthen relations between their countries and the United States. Obama also thanked them for contributing to the counterterrorism campaign against the Islamic State in Iraq and Syria.

With the exception of Spanish Prime Minister Mariano Rajoy, each of the foreign leaders Obama met with had already spoken with President-elect Trump since his election victory. Obama urged them to continue to pursue solutions to common challenges with his Republican successor "on the basis of the core values that define the United States and Europe as open democracies."

"President Obama expressed confidence that, even at a moment of great change, democratic values have done more to advance human freedom and progress than any other system in history, and will continue to do so going forward," the White House said.

Obama and Merkel also discussed trans-Atlantic cooperation during a bilateral meeting Thursday, particularly with the uncertainty looming over the Trump administration's posture toward Russia and commitment to the NATO alliance. The president-elect chose retired Lt. Gen. Michael Flynn to serve as his national security adviser on Wednesday, a move that suggests the new administration could be friendlier toward Moscow than the current one.

Both leaders agreed during the meeting with their counterparts on Friday that Ukraine-related sanctions against Russia must remain until Moscow fully complies with the Minsk agreement negotiated by France and Germany in 2015.

Merkel told reporters on Thursday that she intends to keep an "open mind" with regard to Trump, who accused her of contributing to the demise of Europe by admitting hundreds of thousands of refugees into Germany.

"They're having riots in the streets, they're having crime that they've never had before there, wait until you see the end results of what happens to Germany and Merkel," Trump said on the campaign trail last November.

Obama rejected Trump's assessment by offering his own praise of Merkel's leadership at a joint press conference, saying he could not have asked for "a steadier or more reliable partner on the world stage" during his two terms in office.

The president will depart Berlin on Friday for Peru, the last stop of his final overseas trip while in office. He is expected to meet with additional foreign leaders at the Asia-Pacific Economic Cooperation Summit before returning to Washington.