German Chancellor Angela Merkel visits White House before leaving office

The two leaders reaffirmed a strong U.S.-German partnership.

German Chancellor Angela Merkel visited the White House Thursday for talks with President Joe Biden.

The two leaders held a meeting in the Oval Office before participating in a joint press conference in which they addressed COVID-19 travel bans, relations with China and Russia, protests in Cuba, Biden's "Build Back Better" agenda and more.

On Cuba, Biden said, "Communism is a failed system, a universally failed system. And I don't see socialism as a very useful substitute, but that's another story."

Following the press conference, Biden and Merkel were having dinner with a variety of leaders. Vice President Kamala Harris, House Minority Leader Kevin McCarthy, Senate Minority Leader Mitch McConnell, former Secretary of State Colin Powell, former Democratic nominee for president Hillary Clinton and New Jersey Gov. Phil Murphy were slated to attend.

After deciding not to seek another term in office, her trip likely marks a farewell to Biden and served as a chance for the longtime acquaintances and partners to reaffirm the strong U.S.-Germany bond in the face of global challenges, such as the coronavirus pandemic and rising autocratic influences.

"Chancellor Merkel has been a true friend to the United States, a strong advocate for the transatlantic partnership for multilateral cooperation, as well as for our shared priorities," a senior administration official said ahead of the meeting. "In their meeting, I expect that President Biden will convey gratitude for her leadership role, in Europe and around the world, as she prepares to depart the German political stage, following their elections this September."

The visit has also been an opportunity for the pair to hash out some areas of concern before Merkel's tenure ends.

Despite the warm welcome, challenges remain.

Biden lifted U.S. sanctions on companies helping to build the pipeline in May as a goodwill gesture to European allies, as he worked to get them on board with his tough-on-Russia policies and in a tacit admission that U.S. sanctions ultimately failed to halt construction. That was a move some Republicans, including Sen. Ben Sasse of Nebraska, criticized.

"Instead of treating Putin like a gangster who fears his own people, we're giving him his treasured Nord Stream 2 pipeline and legitimizing his actions with a summit," Sasse said.

It's a topic Biden and Merkel discussed on Thursday.

"While I reiterated my concerns about Nord Stream 2, Chancellor Merkel and I are absolutely united in our conviction that Russia must not be allowed to use energy as a weapon to coerce or threaten its neighbors," Biden said in his remarks after their meeting.

"My view on Nord Stream 2 has been known for some time, good friends can disagree," he added later. "But by the time I became president, it was 90% completed. And imposing sanctions did not seem to make any sense. It made more sense to work with the chancellor on finding out how she'd proceed based on whether or not Russia tried to essentially blackmail Ukraine in some way."

The president said he and Merkel asked their teams to look into "practical measures" they could take together on the issue of energy security.

The official also previewed a so-called Washington Declaration, "which will outline their common vision for cooperation to confront policy challenges," and provide guiding principles for years ahead, even as Merkel's successor takes the helm. The official also anticipated a climate and energy partnership to be announced, though they provided no further details on what that will look like.

Another area of difference between the two leaders is China's rising global influence. While Biden has seen China as a competitor that must be curtailed, Merkel is friendlier towards a rising China, believing their success and a balanced trade relationship between the two countries, will benefit Germany.

Merkel on Thursday acknowledged there were areas where the two countries diverged, but stressed that there are areas of cooperation and competition when it comes to China.

"I think basically, the rules as to how we deal with China ought to rest and do rest on our shared values," she said.

ABC News' Libby Cathey and Lauren King contributed to this report.