WARSAW, Poland — The British and Polish prime ministers pledged Thursday to deepen their cooperation in fighting Russian disinformation, as well as on matters of defense and security.

British Prime Minister Theresa May’s one-day visit to Poland came at a politically turbulent time for both countries, as Britain is negotiating terms for leaving the European Union and Poland finds itself in an escalating standoff with the EU’s leaders, who say a sweeping judicial overhaul completed this week violates fundamental European values.

May was expected to raise the issue during her visit, but when asked about it by a reporter, she avoided criticizing her host.

While invoking Europe’s “collective belief in the rule of law,” May said that the “constitutional issues normally, primarily should be a matter for the individual country concerned.”

She said she was reassured by new Polish Prime Minister Mateusz Morawiecki’s pledge to speak about the issue with the European Commission. The talks are scheduled for Jan. 9.

The commission on Wednesday invoked what is known as Article 7, essentially putting Poland on notice that it is at risk of contravening EU law. Sanctions could follow, though that’s unlikely.

The focus Thursday was on areas of cooperation between Britain and Poland.

“We are both deeply concerned by Russia’s attempts to weaponize information,” May said.

She said the two sides will “bolster cooperation” to ensure that the Kremlin is not successful.

The countries signed a treaty that would deepen defense and security — including cybersecurity — ties between them. They already cooperate in those areas as part of their alliance in NATO, and there are now some 150 British troops in Poland as part of a Western effort to reassure a region nervous about Russia’s resurgence.