Hamburg, Germany CNN  — 

President Donald Trump, coming off a short visit to Poland, was greeted here in Germany on Thursday by the complex reality of foreign relations in the form of a pre-G20 meeting with German Chancellor Angela Merkel.

The two met at the Hotel Atlantic Kempinski Hamburg, where they shared a handshake and brief conversation before the two world leaders left reporters.

It was an instant contrast to the optics of their first meeting in March, which signaled a strained relationship.

Trump did not shake Merkel’s hand before cameras in the Oval Office, although they did at other times of her White House visit. And at a news conference later in the day, much to Merkel’s chagrin, Trump make a joke about American spying practices that were found to have swept up the German chancellor’s conversations during President Barack Obama’s administration.

“As far as wiretapping I guess by this past administration, at least we have something in common, perhaps,” Trump said, turning to Merkel, who didn’t smile.

Merkel, playing host to the international G20 conference on Friday and Saturday in her hometown of Hamburg, has seemingly ensured the conference will be full of prickly issues for Trump, whose relationship with the powerful German leader has so far been frosty.

The priorities of this meeting of the G20 include climate change, immigration and trade, all topics where Trump is at odds with the bulk of European leaders. And Merkel further set up a conflict with Trump in a speech to Parliament in June.

“Whoever believes the problems of this work can be solved by isolationism and protectionism is making a tremendous error,” Merkel said, a not-so-thinly veiled swipe at Trump, who ran for president by promising nationalism, tightened borders, stricter trade deals and has since pulled out of the Paris climate accord.

The two world leaders are meeting Thursday evening before both taking part in broader conversations during the G20.

Trump’s relationship with Merkel has been icy ever since the campaign, when Trump questioned the German leader’s immigration policy.

“What’s happening in Germany, I always thought Merkel was like this great leader. What she’s done in Germany is insane. It is insane. They’re having all sorts of attacks,” Trump said in an October 2015 interview.

German policy towards Trump

Merkel, who is in the midst of running for her fourth term as chancellor of Germany, has taken a forceful posture on the United States and Trump ever since that visit, a departure from the close relationship she had with former President Barack Obama.

She even told voters at a beer hall in Bavaria in May that the United States could no longer be seen as a “reliable” ally for Europe.

Thursday afternoon’s meeting will likely foretell a difficult two days for Trump, who is coming off a near euphoric visit to Poland, where the President was showered with praise from the conservative Polish government.

Trump has so far had an array of results on foreign trips.

Though Trump was heralded when he visited Saudi Arabia and Israel on his first foreign trip, European diplomats bristled at Trump’s rhetoric about Article 5, the principle of common defense, during a speech on the North Atlantic Treaty Organization. And Trump, according to people who traveled with the President, later felt ridiculed during a meeting of the G7 in Italy when leaders implored him to stay in the Paris climate agreement.

Merkel’s meeting may not even be close to the most difficult for Trump during his three day Trip to Germany, though, when he comes face to face with Russian President Vladimir Putin on Friday.

CNN’s Kevin Liptak and Allie Malloy contributed to this report.