Arriving in Brussels for a two-day alliance summit, the US president said it was “totally inappropriate” that Germany was paying billions of dollars to Russia for oil and gas while spending little over 1 per cent of its GDP on defence.
He said that the deal meant that Germany was now “totally controlled” by Moscow.
Mr Trump is due to hold a face-to-face meeting with German Chancellor Angela Merkel - as well as a separate meeting with French President Emmanuel Macron - on the margins of the summit on Wednesday.
“I think it is very sad when Germany makes a massive oil and gas deal with Russia. We are supposed to be guarding against Russia and Germany goes out and pays billions and billions dollars a year to Russia,” he said.
“We are protecting Germany, we are protecting France, we are protecting all of these countries and then numerous of the countries go out and make a pipeline deal with Russia where they are paying billions of dollars into the coffers of Russia. I think that is very inappropriate.
“It should never have been allowed to happen. Germany is totally controlled by Russia because they will be getting 60 to 70 per cent of their energy from Russia and a new pipeline.
“You tell me if that’s appropriate because I think it’s not. On top of that Germany is just paying just a little bit over 1 per cent whereas the United States is paying 4.2 per cent of a much larger GDP. So I think that’s inappropriate also.”
Mr Trump’s comments, at a meeting with Nato secretary general Jens Stoltenberg ahead of the main summit, appeared to set the stage for another stormy international gathering after last month’s G7 meeting in Quebec ended in acrimonious disagreement.
Mr Stoltenberg appeared to be taken aback by the ferocity of his onslaught, insisting alliance members were committed to stepping up their defence spending while acknowledging they needed to do more.
“Even during the Cold War, Nato allies were trading with Russia,” he protested.
However, the president was not deterred, saying: “I think that these countries have to step it up not over a 10-year period, they have to step it up immediately. Germany is a rich country.
“They talk about they are going to increase it a tiny bit by 2030. They could increase it immediately tomorrow and have no problem. We are going to have to do something. We can’t put up with it.
“Germany is a captive of Russia. They got rid of their coal plants, they got rid of their nuclear - they are getting so much of the oil and gas from Russia.”
Ahead of the summit, Theresa May was keen to emphasise Britain’s readiness to contribute, announcing 440 extra troops for the Nato mission in Afghanistan.
“The alliance can rely on the UK to lead by example, not just in meeting the 2 per cent pledge but by contributing our cutting edge capabilities to operations around the world,” she said.
“In committing additional troops to the Train Advise Assist operation in Afghanistan we have underlined once again that when Nato calls the UK is among the first to answer.”
The extra troops, from the Welsh Guards, will bolster the UK-led Kabul Security Force which provides protection for Nato civilian staff engaged in capacity-building programmes in Afghanistan, as well as mentoring Afghan forces in the capital.
They will begin deploying in August with a second contingent to follow in February taking the total UK military presence in the country to 1,100.