TAORMINA, Italy (Reuters) - In Sicily, Donald Trump listened attentively during complex G7 debates over trade and climate change, smiled for the cameras, and for the most part refrained from provocative tweets.
In Brussels, he bashed NATO partners for not spending more on defence, shoved the prime minister of Montenegro and renewed his attacks on Germany's trade surplus with the United States.
America's allies witnessed the two sides of Trump on his first foreign trip as U.S. president, a nine-day tour that began with sword dancing in Saudi Arabia and vague pledges in Israel to deliver Middle East peace.
As Trump headed home, European officials were left with mixed feelings: relief that he had been patient enough to listen to their arguments and unsettled by a Jekyll-and-Hyde figure who is still finding his way on the big policy issues.
"It all fits with his strategic ambiguity approach to life," said Julianne Smith of the Centre for a New American Security. "It may do wonders when dealing with adversaries. But it doesn't work when dealing with allies," she said.
Other leaders of the Group of Seven nations had viewed with trepidation their summit, held at a cliff-top hotel overlooking the Mediterranean, after four preparatory meetings failed to clear up differences with the Trump administration on trade, how to deal with Russia and climate change.
But in the end, officials said, the result was better than they had feared.
The final communique acknowledged a split between the United States and its six partners over honouring the 2015 Paris accord on climate change. That followed a debate with Trump that German Chancellor Angela Merkel described as "very dissatisfying".
However on trade, Trump bowed to pressure from allies to retain a pledge to fight protectionism. And on Russia, he did not insist on removing - as some allies had feared - the threat of additional sanctions for Moscow's intervention in Ukraine.
"I found him very willing to engage, very curious, with an ability and desire to ask questions and to learn from all his interlocutors," said Italian Prime Minister Paolo Gentiloni, the G7 summit's host.
Still, there was irritation at Trump's refusal to show his hand on the Paris agreement to curb carbon emissions. Near the end of the summit, he tweeted teasingly that he would make a decision on Paris next week, leaving delegations to scratch their heads about why he could not commit in Taormina.
The most critical words were reserved for Trump's appearance at NATO headquarters in Brussels, which was described as a "disaster" by more than one European official.
With the leaders of America's NATO partners standing like school children behind him, Trump upbraided them for not spending more on defence and repeated the charge that some members owed "massive amounts of money" from past years - even though allied contributions are voluntary.
Most disturbingly for allies, Trump did not personally affirm his commitment to Article 5, NATO's mutual defence doctrine, after pre-trip signals from the White House that he would do just that. Trump also failed to mention Russia, which remains NATO's raison d'etre in the eyes of most Europeans.
It was a speech that reminded some of Trump's doom-laden inauguration address in January, one that seemed written for the hardest of his hard-core domestic audience. "Proud of @realDonaldTrump for telling NATO deadbeats to pay up or shut up," former Republican governor Mike Huckabee tweeted in response.
Trump's appearance in Brussels was particularly galling to the Germans, who after months of painstaking relationship building with Trump - including Merkel's invitation to his daughter Ivanka for a G20 women's summit in Berlin - found themselves under attack from him on two fronts.
Before heading to NATO, Trump criticised Germany's trade surplus in a private meeting with senior European Union officials.
"If Trump really wants to go down a path of isolation, it will only speed up China's rise to the top," one senior German official grumbled.
Beyond the rhetoric, Trump's body language also confounded his hosts. He muscled aside Montenegrin Prime Minister Dusko Markovic as NATO leaders walked into the alliance's new headquarters for a photo session.
And he engaged in two alpha-male handshakes with France's new 39-year-old President Emmanuel Macron, who seemed to get the better of Trump on both occasions.
The macho posturing in Europe contrasted to the images, a few days earlier, of Trump and his team swaying, swords in hand, with the absolute rulers of Saudi Arabia at a lavish welcome ceremony given by King Salman.
Summing up the tour on Saturday, Trump's advisers seemed most enthused about the Saudi leg, where he clinched a $110 billion arms deal and forged what one aide described as a "personal bond" with the king.
"The president was able to make some of the most amazing deals that have really been made by any administration ever," enthused his economic adviser Gary Cohn.
Daniela Schwarzer, research director at the German Council of Foreign Relations in Berlin, said the trip had confirmed Trump's "zero-sum game" view of the world in which you are either a winner or a loser and relationships are transactional.
"His rhetoric and actions suggest he does not consider it a priority to build good and engaging relations with allies the U.S. so far considered its most important ones," she said.
Writing by Noah Barkin; Additional reporting by Crispian Balmer; editing by David Stamp