U.S. President Donald Trump described Poland as an exemplary ally in building defences to counter Russian "destabilising behaviour", while appearing to encourage Polish defiance towards the European Union.
Trump, en route to a potentially fractious G20 meeting in Hamburg, Germany, urged western NATO allies in Europe to spend more on defence, drawing a comparison with Poland which meets the agreed target of two percent of annual economic output.
The brief visit to Warsaw was billed as an opportunity for him to patch up relations with European allies after a tense alliance summit in May.
Trump said the United States and Poland shared similar values.
"We've discussed our mutual commitment to safeguarding the values at the heart of our alliance: freedom, sovereignty and the rule of law," he said in a joint press conference after meeting Polish President Andrzej Duda.
“We are working with Poland in response to Russia’s actions and destabilizing behaviour. And we are grateful for the example Poland has set … by being one of the few nations that actually meets its (NATO’s) financial obligations."
The Kremlin said it disagreed with U.S. President Donald Trump's assessment of Russia's behaviour as destabilising. Trump is due to meet President Vladimir Putin for the first time on the sidelines of the Hamburg meeting.
Poland and east European allies have expressed deep concern at Russian annexation of the Crimean peninsula from Ukraine, as well as Russian military activity around its borders. Russia argues that this is a response to Western buildup.
Since winning an election in 2015, Poland's eurosceptic Law and Justice (PiS) party has faced criticism from its western European peers over what some call an authoritarian tilt and its opposition to accepting Muslim migrants.
It shares views with Trump on issues such as migration, climate change and coal mining, and has long said Brussels institutions should give back some power to national governments.
Later on Thursday, Trump was slated to condemn "the steady creep of government bureaucracy" and praise the sovereignty of nations in a speech at a Warsaw square, according to excerpts released by the White House.
"The West became great not because of paperwork and regulations but because people were allowed to chase their dreams and pursue their destinies," he will say, according to the White House.
Trump did not mention the EU by name in this context but he has been critical of the EU in the past.
"We must work together to counter forces, whether they come from inside or out, from the South or the East, that threaten over time to undermine these values and to erase the bonds of culture, faith and tradition that make us who we are."
The White House had said Trump would use the stopover in Warsaw to showcase his commitment to the North Atlantic Treaty Organisation, which he once called "obsolete", bemoaning allies' repeated failure to meet the two percent target.
He had unnerved allies in May, not least those in the east concerned about Russia's more assertive military posture, by failing to explicitly endorse the principle of collective defence enshrined in the NATO treaty. He made no explicit reference to that article in his comments.
Duda for his part said he believed Trump took Poland's security seriously.
In Warsaw, Trump was also meeting other central European leaders as well as heads of state from the Balkans and Baltic states, gathered for a so-called Three Seas summit of countries on the Baltic, Black and Adriatic seas. (By Marcin Goclowski and Marcin Goettig; Additional reporting by Roberta Rampton and Jeff Mason, writing by Kevin Liffey and Justyna Pawlak, editing by Ralph Boulton)