DONALD TRUMP’S bark may be worse than his bite, but the bark is a very nasty sound. America’s NATO allies were left with that feeling after a summit in which the American president showed startling rudeness, but in the end raised no objection to a stout pledge of common defence against Russia and other adversaries.

Diplomats had issued careful warnings about the likelihood of robust exchanges at the gathering in Brussels on July 11th-12th, but nobody was quite prepared for the tirade against America’s “delinquent” allies, and Germany in particular, which Mr Trump unleashed on arrival, venting his spleen in front of Jens Stoltenberg, the NATO secretary-general.

The president accused the Germans of being “controlled by Russia.” He complained that billions of dollars a year were flowing from Berlin to Moscow under a new gas-pipeline deal, while Germany had the nerve to expect American help with warding off Russian threats. Angela Merkel, Germany’s chancellor, gave a dignified response, saying she had experienced Soviet domination as a child in East Germany and was glad her united country was now free to make its own decisions.

Mr Stoltenberg, a Norwegian whose job is to act as a kind of lightning-rod for storms raging inside NATO, tried hard to accentuate the positive. He stressed after the main summit meeting that all allies were on track to reach the target of spending at least 2% of GDP on defence. As he spoke, it emerged that Mr Trump had demanded that his allies adopt a target of 4% (which even America itself does not satisfy). Earlier, while the 29 NATO leaders were supposedly incommunicado, a tweet came from the president claiming that he was protecting American farmers from the disastrous effects of European trade policies.

Dazed as they were by Mr Trump’s antics, America’s allies came away with a sense of relief that he had joined them in approving a toughly worded common statement which reaffirmed NATO’s core principle: “Any attack against one ally will be regarded as an attack against us all.” Mr Trump had earlier hinted that NATO members might forfeit this protection unless they boosted their defence spending.

The statement unequivocally rebuked Russia for a long list of old and new misdeeds. These included the “illegal and illegitimate annexation of Crimea and ongoing destabilisation of eastern Ukraine” and the use of a military-grade nerve agent in an assassination attempt in England.

Russia was also taken to task for engaging in provocative activities, such as airspace violations and large exercises held without notice, along with “irresponsible and aggressive nuclear rhetoric” and military build-ups in Crimea and the enclave of Kaliningrad. The allies insisted, however, that they remained open to a meaningful dialogue with Moscow.

All this was, at least some optimists hope, an implicit reassurance to NATO’s European partners that Mr Trump was not about to make a deal over their heads with his Russian counterpart, Vladimir Putin. But as he headed first to Britain before meeting Mr Putin in Helsinki on July 16th, it could all be undone with a single irate presidential tweet, perhaps triggered by British protests. And the meeting in Helsinki could throw up literally anything.

The NATO members also reaffirmed their commitment to a series of costly new initiatives of which James Mattis, the American defence secretary, is the main architect. These include the establishment of new NATO commands in the United States (to guard Atlantic shipping lanes) and in Germany, along with fresh efforts to shore up the Baltic states, Poland and Romania against any Russian misbehaviour.

Mr Stoltenberg summed up the new NATO mood by saying: “For a quarter of a century, many of our countries have been cutting billions from their defence budgets. Now, they are adding billions.” Still, given that NATO is a club of democracies, electorates will also have to be persuaded that this is the right use of their money. And Mr Trump’s outbursts will probably not be much help in winning over European hearts, minds or wallets.