US President Barack Obama and first lady Michelle Obama held a phone call with German Chancellor Angela Merkel and her husband, Joachim Sauer, on Thursday to thank them for their friendship and support during Obama's eight years in office, the White House said.

It was the final call for Obama to a foreign leader, with his successor, Donald Trump, due to be inaugurated at a ceremony on Friday.

In a statement, White House spokesman Josh Earnest said both leaders had emphasized the importance of US-German ties for the world in their conversation.

"The president and the chancellor agreed that close cooperation between Washington and Berlin and between the United States and Europe are essential to ensuring a sturdy trans-Atlantic bond, a rules-based international order, and the defense of values that have done so much to advance human progress in our countries and around the world," the statement said.

It said Obama had called it fitting for his final call to be to the German leader after he had worked with her for eight years.

Obama and Merkel have often phoned over the years

Up-and-down friendship

Obama once described Merkel as probably his "closest international partner these last eight years," though their relationship has not always been completely harmonious.

The friendship was tested notably after leaked documents revealed in October 2013 that the USA had spied on friendly foreign leaders including Merkel, with even the chancellor's personal cell phone coming under surveillance.

But the strength of the bond has become ever more evident, with Obama recently giving Merkel his support during Europe's refugee crisis and praising her as being "on the right side of history."

Merkel also showed a willingness to let bygones be bygones, saying in April last year: "For me, the future with the president is much more important than the past right now."

Will Merkel's relationship with Trump be as good?

Obama's positive view of the German leader contrasts with remarks made by Trump in an interview with two European paperson Sunday, in which the president-elect called Merkel's decision to open Germany's borders to hundreds of thousands of refugees and migrants "catastrophic."

Trump has also called the NATO alliance "obsolete," and appeared to cast doubt on the viability of the European Union.

Aides to the incoming president have since tried to backpedal, saying that Trump wanted a "great relationship" with Merkel.

tj/kl (dpa, AFP)