US President Donald Trump has 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 per cent 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 destabilising 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 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.
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 condemned "the steady creep of government bureaucracy" in a speech at a Warsaw square.
"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.