ROME (AP) — U.S. President Donald Trump's attacks on Italy's premier have had an unintended consequence.

After Trump questioned Italy's reliability as a wartime ally and claimed Giorgia Meloni had groveled for his attention, European leaders rallied to Meloni's side, thawing what had been a frosty relationship over her hard-right political roots.

READ MORE: Trump deepens the dustup with Italy's Meloni, who says his 'unprovoked attacks are senseless'

It is the latest example of how the often divisive American president is helping to draw Europe closer together.

European leaders are finding more reasons to coordinate on defense, tariffs and foreign policy as they confront wars in Ukraine and Iran, a ballooning trade deficit with China, and threats from Russia. That leaves Trump, who has often preferred to negotiate with European countries individually, with less ability to do so, analysts say.