Former president Barack Obama spoke in Berlin on May 25 at a discussion on democracy with German Chancellor Angela Merkel. (Reuters)

Thanks to an awkward coincidence, President Trump is in Brussels at the same time as predecessor Barack Obama is in Berlin. These two trips are certainly offering contrasting views of the United States's relationship with Europe.

Obama was in the German capital Thursday morning to appear alongside German Chancellor Angela Merkel at a biennual festival organized by the German protestant church. The two spoke in front of a large crowd at the iconic Brandenburg Gate, with Obama going out of his way to praise Merkel.

“Not only do I love this city, but one of my favorite partners throughout my presidency is sitting next to me,” Obama said with a smile.

Speaking at the democracy-themed event, he also appeared to offer thinly veiled criticism of Trump, then only a few hundred miles away in Belgium. “We can’t isolate ourselves. We can’t hide behind a wall,” he said, prompting cheers from the audience.

Even before he became president, Obama had endeared himself to Germans. In 2008, while campaigning for the Democratic nomination, he gave a speech to an estimated 200,000 Berliners in Tiergarten park. Five years later, he returned to the city to give a speech in front of the Brandenburg Gate, the iconic location from where Ronald Reagan called on Soviet leader Mikhail Gorbachev to “tear down this wall.”

Merkel became a key Obama ally on the world stage, despite strains over a scandal involving alleged U.S. monitoring of her phone. During Obama's last official trip to Germany, in November, the affection between the two was apparent, and they issued a joint warning against taking democracy “for granted.”

Obama's high standing in Germany is largely shared across the continent. A poll conducted by the Pew Research Center last summer found that 77 percent of Europeans had confidence in him, including 86 percent of Germans. The poll asked Europeans what they thought about Trump, who at that point was a presidential candidate. Just 9 percent of Europeans said they had confidence in him.

Trump's remarks about Europe on the campaign trail may not have helped his cause. He labeled himself “Mr. Brexit” and questioned the logic of the European Union, while warning that the North Atlantic Treaty Organization — a military alliance that binds Europe and North America — may be “obsolete.” He even singled out Merkel, saying she was “ruining Germany” with her immigration policies.

President Trump criticized leaders at a dedication ceremony at the new NATO headquarters in Brussels, May 25, saying they need to increase financial contributions to combat "the threat of terrorism." (The Washington Post)

As Obama and Merkel spoke in Berlin, Trump was in Brussels — the center of European political power and a city he once called a “hellhole” — as part of his first foreign trip as U.S. president. The trip has included stops in Saudi Arabia, Israel and the Vatican.

In the Belgian capital, Trump met with E.U. officials Thursday morning and later in the day will attend a working dinner with world leaders — including Merkel — representing NATO members. In April, Trump toned down his criticism of the organization, even saying that the alliance was “no longer obsolete.” Such comments mark a broader trend for Trump, who has walked back some of his harshest criticisms of Europe since becoming president.

“So far his bark has been worse than his bite when it comes to the core issues Europeans care about,” said Charles Kupchan, a senior fellow at the Council on Foreign Relations and professor of international affairs at Georgetown University.

However, Trump's time in Europe may also have its share of tricky moments. He will meet with British Prime Minister Theresa May later Thursday. She is expected to raise the issue of apparent leaks of shared intelligence about Monday’s Manchester bombing. Trump has ordered the Justice Department to launch a full investigation into the leaks, adding in a statement Thursday that “there is no relationship we cherish more than the Special Relationship” with Britain.

Trump also had a private lunch with new French President Emmanuel Macron at the residence of the U.S. ambassador to Belgium on Thursday — a meeting that prompted a widely mocked video of the pair shaking hands, if nothing else.

President Trump and French President Emmanuel Macron shared an intense handshake at their first meeting on May 25. (The Washington Post)

After the NATO meeting, Trump will head to Sicily for a Group of Seven meeting of the world's top industrialized nations. His time in Europe is important. “European leaders and publics are still sizing him up,” Kupchan said. “Opinions will firm up over the course of the next 48 hours.”

That Obama received such a rapturous reception in Berlin probably won't help. Several aspects of Trump's first foreign trip have been compared unfavorably with his predecessor's: After Trump signed a short, curiously upbeat message at Israel's Holocaust memorial Tuesday, social media users began sharing the lengthy and solemn note Obama wrote when he visited Yad Vashem in 2008.

By all accounts, Obama's trip to Berlin was long planned and not designed to clash with Trump's Europe sojourn. However, the awkward timing may benefit at least Merkel, who is facing reelection in September.

German Chancellor Angela Merkel told world leaders at NATO headquarters, May 25, that preserving "open societies" leads to success, not "the building of walls." (The Washington Post)

“If you look at public opinion surveys, Barack Obama has retained a popularity in Germany that Donald Trump has not achieved,” said Karen Donfried, president of the German Marshall Fund and a member of the National Security Council during the Obama administration. “Given the political year that we have in Germany, with a national election in September, the chancellor could be well served by showing her relations with both the past U.S. president and the current U.S. president.”

More on WorldViews

NATO in decline? A poll shows growing support — on both sides of the Atlantic

Pope Francis presents Trump with a ‘politically loaded gift’: His encyclical on climate change