The officials said Trump threatened to "do his own thing".
"NATO is much stronger now than it was two days ago", Trump said. "Everyone in the room thanked me". "It has been really incredible to see the level of spirit in that room".
Merkel said: "We had a very intense summit".
It was not immediately clear what specific new commitments had been made.
At the moment, North Atlantic Treaty Organisation members are supposed to spend 2% of GDP on defense-a goal, not a requirement or a membership fee-but only eight of the alliance's 29 members will do so this year.
Stoltenberg estimated European allies and Canada will add $266 billion to their military spending by 2024 and said, "this is really adding some extra momentum", apparently meaning Trump's pressure. He said leaders committed to go to their parliaments to obtain the spending increases.
Merkel said she welcomed the chance to have an "exchange of views" with Trump.
Energy exports represent Russia's main source of revenue, and Trump argues that the pipeline undermines NATO's goal, as it's created to counter Russian aggression.
French President Emmanuel Macron said the summit atmosphere was "much calmer than everyone had said" and he saw a will to maintain the unity of the alliance, while Croatian President Kolinda Grabar-Kitarovic said Trump was "constructive".
The meeting with the Russian president will arguably be the most attention-grabbing leg of Trump's European tour.
Mr Trump's early-morning tweets from Brussels had been typically critical.
Senate Republican Conference Chairman John Thune, who also traveled to Russian Federation, said Trump should be prepared for complete denials and well-rehearsed answers when he meets with Putin in Finland's capital. "They pay only a fraction of their cost".
Praising new initiatives to build capacity, NATO Secretary General Stoltenberg estimated that as much as 266 billion additional US dollars would be spent by European allies and Canada on defense by 2024. "The commitment was at 2 percent, ultimately that'll be going up quite a bit higher than that".
Also Thursday, Nato Secretary-General Jens Stoltenberg insisted that Georgia will one day join the world's biggest security alliance, despite separatist ambitions in parts of the former Soviet republic.
"Many countries are not paying what they should", Trump said, seated across from a visibly rattled Stoltenberg.
"I think I can probably can [pull out of NATO], but that's unnecessary, and the people have stepped up today like they've never stepped up before", Trump added.
Instead, a series of events - a black-tie dinner with business leaders, a meeting with May and an audience with Queen Elizabeth II - will happen outside the bustling city, where Mayor Sadiq Khan has been in a verbal battle with Trump.
Duda also told reporters Thursday that the leaders' meetings were confidential and that he was surprised at other leaders who leaked details to the media. "He sees it as a zero-sum game where the United States can call the shots".