U.S. President Donald Trump affirmed his administration's commitment to NATO's defence on Thursday, while calling on Russia to end its "destabilizing" action in Ukraine and elsewhere in the world.

Trump's reference to Article 5 of the NATO treaty, which commits alliance members to defend each other, represented a change of tone from the U.S. president, who upset allies by not mentioning support for the provision during a trip to NATO headquarters in May.

"We stand firmly behind Article 5," Trump said during a speech — laced with warnings about the dangers faced by Western civilization — in Warsaw, Poland.

CBC AT THE G20 | Trudeau heads to summit marked by widening Trump-Merkel rift

But he again called on NATO members, most of which are in Europe, to meet their financial requirements under the terms of the alliance, which requires each of the 29 countries to spend two per cent of GDP on defence.

"Europe must do more," Trump said. "Europe must demonstrate it believes in the future by investing money to secure that future."

"The fundamental question of our time is whether the West has the will to survive. Do we have the confidence in our values to defend them at any cost?"

Trump praised Poland for meeting its NATO commitments, and for its recent decision to purchase the U.S.-made Patriot missile defence system.

Trump's speech focused on the threat posed by terrorism but appeared to include several veiled remarks about Russia, including references to the hardships Poland faced from the Soviet Union and a remark about the modern forms of aggression — "propaganda, financial crimes and cyber warfare" — now aimed at NATO.

The crowd also cheered when Trump said securing access to new energy sources means Poland will "never again be held hostage to a single supplier of energy." Poland relies heavily on Russia for oil and gas, but a long-term contract for liquefied gas delivered from the U.S. could be signed "soon" according to Polish President Andrzej Duda.

People wave Polish and U.S. flags during Trump's speech at Krasinski Square. (Carlos Barria/Reuters)

Trump was more blunt when he condemned Moscow's role in Ukraine and the Middle East.

"We urge Russia to cease its destabilizing activities in Ukraine and elsewhere and its support for hostile regimes including Syria and Iran, and to instead join the community of responsible nations in our fight against common enemies and the defence of civilization itself," he said, echoing remarks made earlier in the day during a joint news conference with Duda.

His remarks come ahead of his first face-to-face meeting with Russian President Vladimir Putin in Germany during the G20 summit on Friday.

The Kremlin said in a statement it disagreed with Trump's initial comments and that it regretted a lack of understanding between Russia and the U.S. about expectations for their future relations.

Trump also told reporters that the U.S. was working with Poland to address Russia's "destabilizing behaviour" in the region — remarks that prompted a rebuke from the Kremlin.

U.S. President Donald Trump is greeted by Polish President Andrzej Duda as he visits Poland during the Three Seas Initiative Summit in Warsaw, Poland July 6. (Carlos Barria/Reuters)

"We disagree with such an approach," Kremlin spokesman Dmitry Peskov said during a conference call with reporters.

Peskov said that the Kremlin also regretted a lack of understanding between Russia and the U.S. about expectations for their future relations.

"This is exactly why we are waiting for the first meeting of the two presidents," said Peskov.

Trump started his first day in Europe at the Royal Castle, welcomed by President Andrzej Duda and a vigorous handshake in front of a white marble bust of Stanislaw August Poniatowski, the last king of Poland. The leaders then retreated to a room decorated with red walls for their private talks.