WATFORD, England—In public, NATO leaders traded barbs and griped over differences at a two-day meeting here. In private meetings, they patched up rifts and reached agreements on strategic issues and defense initiatives.
Leaders of the 29-member North Atlantic Treaty Organization formally recognized the challenge of China’s rise for the first time. They designated land, naval and air units that can be ready to fight within a month—a central part of the alliance’s response to the threat from Russia.
They agreed to create a group to help shape the alliance’s future strategy, a response to French President Emmanuel Macron’s criticism that the alliance was experiencing “brain death.”
And Turkey said it would endorse a new defense plan for Poland and the Baltic countries, which it had threatened to block, demanding recognition of Kurdish armed groups as terrorists in return.
“Politicians are very often criticized for being good on rhetoric and then bad on substance. In NATO, in one way it is the opposite,” NATO Secretary-General Jens Stoltenberg told reporters after the meeting. “The rhetoric is not always excellent, but substance is perfect.”
To be sure, tensions remained over matters ranging from Turkey’s incursion into northern Syria to weak defense spending by some allies.
The alliance had striven to avoid the kind of outburst from President Trump over allies’ weak spending that marred the leaders’ previous meeting, last year in Brussels. Mr. Macron scrambled those plans when he criticized NATO in strong terms for focusing on financial and technical issues rather than big strategic questions regarding European defense and how to fight terrorism.
Mr. Trump clashed with Mr. Macron at a press conference on Tuesday over tariffs, Islamic State and the future of NATO. The U.S. president on Wednesday called Canadian Prime Minister Justin Trudeau “two-faced” and skipped a press conference after a video emerged of Mr. Trudeau and other leaders discussing Mr. Trump without him present.
But behind closed doors at the three-hour meeting, there was little friction, according to officials present.
German Chancellor Angela Merkel, whose country is a frequent target of Mr. Trump, said leaders had “a good discussion on substance.” One of her aides to said meetings went well and there was no discord behind closed doors.
“It was almost like the old times,” said a European diplomat.
Mr. Trump read from prepared remarks urging allies in strong terms to increase spending, two officials said. Other leaders responded that their spending was increasing, and that they were contributing in other ways, including with military units and lives lost on operations.
After the meeting, Mr. Trump praised the alliance on Twitter.
“Great progress has been made by NATO over the last three years,” Mr. Trump wrote. He cited fresh figures from NATO that European allies and Canada will add a cumulative $130 billion in spending by the end of 2020 from 2016. “NATO will be richer and stronger than ever before,” he said.
In a joint declaration, leaders recognized “opportunities and challenges” in China’s growing influence, adding top-level endorsement to NATO’s efforts to develop a strategy to address its growing power.
The declaration also said that “Russia’s aggressive actions constitute a threat to Euro-Atlantic security,” which officials noted was particularly strong language agreed by all allies.
Mr. Macron has pushed for a deeper dialogue with Russia, causing concern among some allies who say that Russia has done nothing to earn a reprieve. Germany expelled two Russian diplomats on Wednesday in retaliation for what Berlin said was Moscow’s refusal to cooperate in a murder investigation after German prosecutors linked the Kremlin to the assassination of a Chechen rebel in Berlin.
Mr. Macron said Wednesday that Moscow needed to fulfill certain conditions if it wanted relations to improve, including taking steps to resolve the conflict that it triggered in eastern Ukraine.
“Russia is a threat in certain areas. It is also a neighbor,” he told a press conference.
Mr. Stoltenberg announced that allies had identified 30 battalions, 30 air squadrons and 30 ships that can be ready in 30 days, an initiative aimed at countering threats, particularly from Russia.
The secretary-general will also lead what the declaration called a “reflection process” about the future of NATO. The still vaguely defined process responds to Mr. Macron’s criticism without endorsing his “brain death” diagnosis, officials said.
Several tensions linger.
Turkey has irritated allies with its incursion into northeastern Syria and purchase of a Russian antiaircraft missile system. It couldn’t immediately be established why Turkey changed its mind over the new defense plan for Poland and the Baltic countries, as allies said they wouldn’t designate the Kurdish groups as terrorists.
Addressing China could be contentious as the U.S. has advocated a strong line including a ban on equipment from Chinese telecoms equipment provider Huawei, while some European countries have been less categorical.
Defense spending could still prove nettlesome if allies backslide on pledges to reach the target of spending 2% of gross domestic product on defense by 2024, which Germany says it will hit years later.
On Wednesday, Mr. Stoltenberg ended his press conference by praising the meeting’s “very good atmosphere.”
Toward the end of the leaders’ meeting, the prime minister of North Macedonia, which will soon become NATO’s 30th member, gave a speech about the value of the alliance to his small Balkan country, according to officials present. Leaders and other officials in the room broke into applause.
Write to James Marson at james.marson@wsj.com