Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

There initially seemed to be little love between President Donald Trump and his French counterpart, Emmanuel Macron.

Macron made headlines when he swerved away from Trump and instead hugged German Chancellor Angela Merkel at a NATO summit last year.

But while China’s Xi Jinping and Japan’s Abe Shinzo were treated to dinner at Trump's Mar-a-Lago club, Macron will have the honor of being the first foreign leader to be welcomed at the Trump White House for an official state visit, with all the ceremonial pomp that goes with it.

White House Press Secretary Sarah Huckabee Sanders has confirmed the Macron visit, but said a date was still being finalized. French Foreign Minister Jean-Yves Le Drian said this week that Macron would visit Washington in late April, but referred to it as an "official visit," not a state visit. The reason for the apparent discrepancy is unclear.

President Donald Trump shakes hands with French President Emmanuel Macron in Brussels, Belgium, on May 25. Evan Vucci / AP file

For Nicholas Dungan, a senior fellow at the Atlantic Council in Washington, Trump's choice of Macron was not terribly surprising.

“Macron’s the golden boy,” Dungan told NBC News. “The state visit signals that he has been extremely skillful in positioning 'Macron and Trump' and in positioning 'France and the United States,'” Dungan added.

Yet their relationship didn’t start on the best of terms.

Show of dominance

During the French presidential election, Trump openly backed Macron’s opponent, the far-right candidate Marine Le Pen, whose anti-Europe policies and isolationist stance contrast starkly with Macron’s own pro-Europe, pro-globalization rhetoric.

Then came the white-knuckle handshake at their first meeting on the sidelines of a NATO summit in Brussels in May. The French president, who reportedly studied Trump’s unique style of forcefully yanking the other person’s hand in a show of dominance, held on strong until it was the American president who backed down first.

The video went viral.

Later in the day as leaders were gathering for a photo opportunity, Macron pointedly swerved past Trump to shake hands with German Chancellor Angela Merkel first. The snub was, again, widely reported.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

But since then, Macron seems to have changed his tune toward the American leader.

“Macron has handled Trump with incredible skill: respecting the individual and very importantly, demanding respect from Trump,” Dungan said.

'A great guy'

Macron started the charm offensive on Bastille Day last year, inviting Trump as the guest of honor to commemorate the 100th anniversary of the U.S. entry into World War I. The two leaders and their wives watched the traditional annual military parade and enjoyed a Michelin-starred meal on the second floor of the Eiffel Tower.

The honor chimed well with Trump. Several days after the whirlwind visit he described Macron as “a great guy. Smart. Strong,” in an interview with The New York Times, adding that they had "a great relationship."

But it’s behind the scenes that Macron has been the most active, regularly consulting with his American counterpart by phone.

“I call him very regularly,” Macron told the BBC recently. “I’m always very direct and frank. He is [too]. Sometimes I manage to convince him, sometimes I fail.”

For Alexandra de Hoop Scheffer, head of The German Marshall Fund of the United States in Paris, a nonpartisan American public policy think tank that focuses on trans-Atlantic cooperation in the spirit of the Marshall Plan, Macron is just being practical.

“Pragmatism and opportunism really prevails in Macron’s approach," de Hoop Scheffer said. “Macron’s approach is about trying to find common ground, interests, cooperation with Washington while clarifying red lines."

The French leader has been transparent about his desire to re-establish France as the leader of Europe and at the center of global diplomacy. A strong relationship with the U.S. is key to that, and he’s been helped by the U.K. and Germany becoming increasingly inward-looking as their respective governments deal with Brexit and coalition talks.

“He’s portrayed himself as the interpreter of Trump’s policies in Europe, and he’s become the key interlocutor of Trump in Europe,” de Hoop Scheffer said.

"They both want to be powerful heads of powerful countries."

The news media has made much of the two presidents' similarities: Neither has held elected office before, and both share a 24-year age gap with their spouses — Trump being the senior in his marriage, and Macron the junior in his.

But the similarities also extend to their world views.

“In essence, they both want to be powerful heads of powerful countries,” Dungan said. "They agree on a fundamental conception of the importance of sovereign action.”

They also agree on many policy issues and “share more or less the same policy objectives,” especially on security and counterterrorism issues, as well as on China and Iran, according to de Hoop Scheffer.

“But where they diverge is on the approach,” she explained.

One wants to Make America Great Again by pulling out of multilateral agreements; the other wants to Make France Great Again by playing a bigger role on the international stage.

French President Emmanuel Macron and President Donald Trump watch the the annual Bastille Day military parade in Paris on July 14. Joel Saget / AFP - Getty Images file

They also disagree on the impact of climate change, with Trump having pulled the U.S. out of the Paris climate accord.

British Prime Minister Theresa May's invitation of a state visit to Trump has inspired virulent opposition, including a petition signed by over 1.85 million citizens to prevent it and a call from London Mayor Sadiq Khan to cancel it.

But unlike in the U.K., the French public has been fairly relaxed about its leader's warm relationship with Trump. That's despite a recent Dentsu/Le Figaro poll which found that nine out of 10 French people have an unfavorable opinion of the American leader.

“The French people are as pragmatic as their president: They believe that having a good relationship with Washington and having their president able to influence his American counterpart is seen as a positive,” de Hoop Scheffer explained.

Dungan offered a different view.

"The fact that there is an old, bombastic, ignorant, immature person who’s American isn’t surprising to the French," Dungan said. "The only thing that is is that he managed to get elected."