LONDON — The European Union is accustomed to crises. But it is probably safe to say that none of the 28 leaders who are gathering in Malta on Friday expected the crisis that has overtaken the agenda: the United States of America.

Like much of the world, the European Union is struggling to decipher a President Trump who seems every day to be picking a new fight with a new nation, whether friend or foe. Hopes among European leaders that Mr. Trump’s bombastic tone as a candidate would somehow smooth into a more temperate one as commander in chief are dissipating, replaced by a mounting sense of anxiety and puzzlement over how to proceed.

If many foreign leaders expected a Trump administration to push to renegotiate trade deals, or take a tough line on immigration, few anticipated that he would become an equal opportunity offender. He has insulted or humiliated Mexico, Britain, Germany and Iraq; engaged in a war of words with China and Iran; and turned a routine phone call with the prime minister of Australia, a staunch ally, into a minor diplomatic crisis.

With the possible exception of NATO, where he has softened his tone, Mr. Trump has expressed disdain for other multilateral institutions such as the European Union. His praise has been reserved for populists and strongmen, like Nigel Farage, the former leader of the U.K. Independence Party, President Rodrigo Duterte of the Philippines and, of course, President Vladimir V. Putin of Russia.