European alliance members were braced for criticism from Trump on defense spending, but his blistering attack on Germany at a breakfast meeting with NATO chief Jens Stoltenberg took the summit by surprise.
"Germany is a captive of Russia because it is getting so much of its energy from Russia," Trump said, taking particular aim at the proposed Nord Stream II gas pipeline, which he has previously criticized.
He said the pipeline project has made Germany “totally controlled” by Russia.
“I have to say, I think it’s very sad when Germany makes a massive oil and gas deal with Russia where we’re supposed to be guarding against Russia,” Trump said at breakfast with Stoltenberg. "Everybody's talking about it all over the world, they're saying we're paying you billions of dollars to protect you but you're paying billions of dollars to Russia."
The criticism was an unusual one coming from Trump, who has appeared eager to make nice with Russian President Vladimir Putin.
Merkel, who grew up in Soviet-dominated East Germany, ramped up the febrile atmosphere of the summit with a sharp reply on arriving at NATO HQ, saying Germany had the right to make its own policy choices.
"I myself have also experienced a part of Germany being controlled by the Soviet Union," she said.
"I am very glad that we are united today in freedom as the Federal Republic of Germany and that we can therefore also make our own independent policies and make our own independent decisions."
Trump has long complained that European NATO members do not pay enough for their own defense, accusing them of freeloading on America and singling out Germany for particular criticism.
NATO allies agreed at a summit in Wales in 2014 to move towards spending two percent of GDP on defense by 2024. But Germany, Europe's biggest economy, spends just 1.24 percent, compared with 3.5 percent for the US.
"These countries have to step it up – not over a 10 year period, they have to step it up immediately," Trump said.
"We're protecting Germany, France and everybody... this has been going on for decades," Trump said. "We're not going to put up with it, we can't put up with it and it's inappropriate."
The mercurial tycoon said before leaving Washington that his meeting in Helsinki with Putin on Monday "may be the easiest" part of his European tour, which also includes a trip to Britain, where the government is in crisis over Brexit.
Trump ramped up his rhetoric ahead of the talks, explicitly linking NATO with the transatlantic trade row by saying the EU shut out US business while expecting America to defend it.
EU President Donald Tusk stepped up to the fight with his own salvo against Trump on Tuesday, telling him to "appreciate your allies".
AFP and AP contributed to this story