WATFORD, England (Reuters) - NATO leaders set aside public insults ranging from “delinquent” to “brain dead” and “two-faced” on Wednesday, declaring at a 70th anniversary summit they would stand together against a common threat from Russia and prepare for China’s rise.

Officials insisted the summit was a success: most notably, Turkish President Tayyip Erdogan backed off from a threat to block plans to defend northern and eastern Europe unless allies declared Kurdish fighters in Syria terrorists.

But the meeting began and ended in acrimony startling even for the era of U.S. President Donald Trump, who arrived declaring the French president “nasty” and left calling Canada’s prime minister “two-faced” for mocking him on a hot mic.

“We have been able to overcome our disagreements and continue to deliver on our core tasks to protect and defend each other,” NATO’s ever-optimistic Secretary-General Jens Stoltenberg told a news conference.

In a joint declaration, the alliance’s 29 leaders said: “Russia’s aggressive actions constitute a threat to Euro-Atlantic security; terrorism in all its forms and manifestations remains a persistent threat to us all.”

The half-day summit at a golf resort on the outskirts of London was always going to be tricky, with officials hoping to avoid bust-ups that burst forth at their meeting last year when Trump complained about allies failing to bear the financial burden of collective security.

This year’s meeting was made even more difficult by Erdogan, who launched an incursion into Syria and bought Russian missiles against the objections of his allies, and by French President Emmanuel Macron, who had described the alliance’s strategy as brain dead in an interview last month.

In public it seemed to go worse than expected, beginning on Tuesday when Trump called Macron’s remarks “very, very nasty” and described allies who spend too little on defense as “delinquents” - a term officials said Trump used again on Wednesday behind closed doors during the summit itself.

At a Buckingham Palace reception on Tuesday evening, Canada’s Justin Trudeau was caught on camera with Macron, Britain’s Boris Johnson and Mark Rutte of the Netherlands laughing at Trump’s long press appearances. “You just watched his team’s jaws drop to the floor,” said Trudeau.

Trump said Trudeau was upset because he had called him out for not meeting his 2% of national output contribution to NATO’s costs. “He’s two-faced,” Trump said of his North American neighbor.

But in a news conference after the summit, Trudeau said his “jaw drop” comment had been referring to Trump’s unexpected announcement that the next G7 summit will take place at Camp David and he had meant no offense.

“We had a great meeting yesterday between me and the president,” he said.

By the time the summit wound up on Wednesday, Trump had decided not to hold a final press conference, saying he had already said enough, including commenting on Britain’s upcoming election on Tuesday, despite saying he didn’t want to.

Slideshow ( 35 images )

HUAWEI SECURITY RISK

Despite the spats, officials said important decisions were reached, including an agreement to ensure the security of communications, including new 5G mobile phone networks. The United States wants allies to ban equipment from the world’s biggest telecoms gear maker, Chinese firm Huawei.

“I do think it’s a security risk, it’s a security danger,” Trump said in response to a question on Huawei, although the leaders’ declaration did not refer to the company by name.

Slideshow ( 35 images )

“I spoke to Italy and they look like they are not going to go forward with that. I spoke to other countries, they are not going to go forward,” he said of contracts with Huawei.

Ahead of the summit, Johnson - the British host who chose to avoid making any public appearances with Trump given next week’s election - appealed for unity, saying the alliance forged in Britain had more to unite it than divide it.

Asked about Huawei, Johnson said it was important to balance foreign investment and security, adding that Britain would not take a decision out of step with its intelligence allies.

“We cannot prejudice our vital national security,” he said. “Nor can we prejudice our ability to cooperate with other vital Five Eyes security partners - and that will be the key criteria that informs our decision about Huawei.”

Macron held his ground over his earlier criticism of NATO’s strategy, saying as he arrived that it was important for leaders to discuss issues in an open and forthright manner if they were to find solutions.

“I think it’s our responsibility to raise differences that could be damaging and have a real strategic debate,” he said. “It has started, so I am satisfied.”

One of Macron’s chief complaints is that Turkey, a NATO member since 1952 and a critical ally in the Middle East, has increasingly acted unilaterally, launching its incursion in Syria and buying Russian S-400 anti-aircraft missiles.

In his comments to the press, Stoltenberg said that while Russia was a threat, NATO also wanted to ensure a constructive dialogue with it. He added, in a reference to Turkey, that the S-400 system was in no way compatible with NATO’s defense.

France and Germany also won backing for a strategic review of NATO’s mission, with the alliance set to establish a “wise persons” group to study how the organization needs to reposition for the future. That could involve shifting its posture away from the East and toward threats in the Middle East and Africa.