US President Donald Trump has argued that the future of Western civilisation is at stake in a keynote speech in the Polish capital Warsaw.
Holding up Poland as an example of a country ready to defend Western freedoms, he warned against the threats of "terrorism and extremism".
Criticising Russia, Mr Trump urged Moscow to "join the community of responsible nations".
Mr Trump is in Poland ahead of a G20 summit in Hamburg, Germany.
In Warsaw, he addressed a large, cheering crowd from the monument to the 1944 Uprising in the city, on Krasinski Square.
Poland's conservative government shares Mr Trump's hostile view of immigration and strong sense of sovereignty.
What did Trump say exactly?
"As the Polish experience reminds us, the defence of the West ultimately rests not only on means but also on the will of its people to prevail," Mr Trump said.
"The fundamental question of our time is whether the West has the will to survive."
He called on Russia to "cease its destabilising activities in Ukraine and elsewhere and its support for hostile regimes including Syria and Iran".
Instead, he said, Russia should "join the community of responsible nations in our fight against common enemies and in defence of civilisation itself".
The US leader is to meet Russian President Vladimir Putin for the first time in Hamburg.
Kremlin spokesman Dmitry Peskov said the Russian presidency did not accept that Russia had been destabilising the region.
"This is exactly why we are waiting for the first meeting of the two presidents," he added.
Giving a news conference hours before the speech, Mr Trump:
- called on countries to demonstrate to North Korea that there were consequences for its "very bad behaviour" and said "something will have to be done about it"
- said America's "strong alliance with Poland and Nato" remained "critical to deterring conflict"
- said in reference to Syria that "any nation which values human life can never tolerate the use of chemical weapons"
- said CNN had taken "too seriously" a mock video he tweeted in which he wrestles a person with the broadcaster's logo for a head
American gas for Europe?
Mr Trump also said talks he had attended in Warsaw of 12 nations with interests in the Baltic, the Adriatic and the Black Sea - the "Three Seas" summit - had been "incredibly successful".
The Polish government is trying to become less energy-dependent on Russia, and last month the first ever US liquefied natural gas (LNG) shipment arrived.
Commending American LNG, Mr Trump told the news conference: "You can never be held hostage to a single supplier."
A global glut in supply, however, has depressed prices and made it difficult for LNG exporters to turn a profit, Adam Sieminski, an energy analyst with the Center for Strategic and International Studies, was quoted as saying by Reuters news agency.
Warsaw and three Baltic states have spoken against the construction of an offshore Russian gas pipeline to Germany, known as Nord Stream 2.
Why did Trump single out Poland?
US leaders are almost always guaranteed a warm welcome in Poland, which will contrast with the protests being planned for the G20 summit in Hamburg.
Mr Trump talked of "the triumph of the Polish spirit over centuries of hardship" as an inspiration "for a future in which good conquers evil, and peace achieves victory over war".
Sandwiched between Germany and Russia, Poland suffered centuries of partition and occupation and emerged from the Cold War a staunch ally of America, ready to commit troops to the US-led coalitions in Iraq and Afghanistan.
By choosing to speak at the monument to the Warsaw Uprising, which was a desperate action ultimately crushed by the Nazis, Mr Trump appealed to fierce national pride.
Poland's current government has been at odds with some other EU states over its refusal to accept refugees under a 2015 solidarity plan.
Mr Trump's visit is seen as mutually beneficial by both Mr Trump and the Polish government, the BBC's Adam Easton reports from Warsaw.
However, the Polish branch of Greenpeace is using Mr Trump's visit to Warsaw to protest against his decision to pull the US out of the Paris climate agreement.
The words "No Trump Yes Paris" were projected in huge green letters on the city's Palace of Culture and Science on Wednesday.
Will the G20 go smoothly?
Later on Thursday, the US leader will travel to Hamburg for what could be a potentially fractious summit.
He has fallen out with some EU nations over climate change and trade. UK Prime Minister Theresa May will challenge him over climate change, saying an international agreement on the issue should not be renegotiated.
Aid organisations are expected to hold demonstrations in Hamburg urging the heads of government to do more to tackle inequality.
"It's important because you have the biggest meeting of all of the leading rulers of the main countries in the world - the G20 - and I don't like some of the politics that they're doing, especially that of [Recep Tayyip] Erdogan, of Putin and of Trump," one protester told the BBC.
Security in Hamburg has been tightened, with police warning of potentially violent clashes. They have already confiscated a number of homemade weapons.
Which trade deal does not involve Trump?
EU leaders signed an agreement in principle with Japanese Prime Minister Shinzo Abe in Brussels on Thursday for a landmark free trade deal.
It is estimated that 99% of trade between Japan and the EU will be liberalised, while an accompanying strategic partnership deal will see them co-operate in other areas, from climate change to tackling terrorism.
Both want to show they are committed to a world order built on open trade and international co-operation, in contrast to Mr Trump's America that is turning inward, BBC Europe correspondent Damian Grammaticas reports.
EU-Japan trade talks had stalled after four years but when Mr Trump took office and scrapped his own possible Pacific trade partnership this year, it spurred them into action, and they resolved most of their differences in a matter of weeks.