Trump, who is seeking re-election, sparked outrage among Western partners at the weekend, after suggesting the United States might not protect NATO allies who are not spending enough on defence from a potential Russian invasion.
"Any relativisation of NATO's guarantee of assistance is irresponsible and dangerous," Scholz told reporters during a joint news conference with Polish Prime Minister Donald Tusk on Monday.
"It is solely in Russia's interests. Nobody should play around or trade with Europe's security."
Tusk travelled to Paris and then Berlin seeking closer ties with Europe's two largest powers as the war in Ukraine enters its third year and Europe's capitals eye the possibility of Trump returning to the White House.
There is no alternative to the partnership between Europe, NATO and the United States for facing mounting security risks, he said earlier on Monday in a joint statement with French President Emmanuel Macron.
"It is probably here in Paris that the words from The Three Musketeers by Alexandre Dumas resonate most clearly: 'All for one, and one for all'," he said, referring to Dumas' novel.
Still, it is in the interest of all NATO countries to increase funding for joint military capabilities, regardless of what Trump said, Tusk told reporters in Berlin.
"There is no reason for the EU to be weaker than Russia" he said, adding that Europe should achieve "greater air defence capabilities and ammunition production capabilities" within a year or so.
Germany will reach the NATO target of spending 2% of economic output on defence this year - and will continue to reach it in the following years, Scholz said.
Warsaw, Paris and Berlin see EU unity on defence and a ramping up of the 27 member states' support for Ukraine as crucial at a time when US backing of Kyiv is wavering amid political infighting in Washington.
"Europe has to get its act together... This is a matter of answering a question about what will happen if Trump wins. We don't have time. We must have bigger defence industry capacity," said a Polish government source.
The source added that Europe urgently needed joint production of ammunition and that Poland was no longer blocking "strategic autonomy" - making Europe less dependent on others.
The shift has been noticed.
"Now for the first time a Polish government is saying that strengthening the European Security Defence Capabilities area is not a contradiction to a strong NATO," said Dietmar Nietan, a German official in charge of cooperation with Poland.
Relations between Poland and Germany were strained by eight years of nationalist rule in Warsaw. The campaign for October's Polish election saw the Law and Justice (PiS) party, in power from 2015 to 2023, cast Berlin as villain on everything from migration to energy.
However, analysts say the return of former European Council President Tusk to prime minister makes it easier to reinvigorate the "Weimar Triangle" platform of political cooperation between Germany, France and Poland created in 1991.
"Good cooperation between Poland, France and Germany is good for Europe," said Scholz. "So we are going to capitalize on this format as much as we can."
Macron said it was a joy to have Tusk back, "and have through your government, partners who we can trust, are pro-European and clear on European security and the major challenges we face."
A French diplomatic source said that injecting new energy into the European project was necessary in an important electoral year for Europe and the US.
The French source said talks would focus on issues from combating Russian disinformation and helping Ukraine to strengthening the European defence industry.
"Our strength lies in the fact that we in France, Poland and Germany look at our Europe from different perspectives," German Foreign Minister Annalena Baerbock said ahead of arriving in Paris for a meeting of the foreign ministers of the Weimar Triangle.
"People in Europe rightly expect that we will develop impulses from this."