Poland will extend its ban on imports of grain from Ukraine unless the European Union allows its own restrictions to stay in place beyond Friday — a move that raises tensions with both Kyiv and Brussels.

The government in Warsaw approved the plan Tuesday, effectively issuing an ultimatum to the EU three days before the scheduled expiration of the bloc’s measures. Meanwhile, Hungary and Romania reiterated that EU import restrictions should be extended until at least the end of the year.

“We’re convinced that the EU is wavering and will allow for the extension” of the current restrictions, Polish Agriculture Minister Robert Telus said in a radio interview on Tuesday. “If it doesn’t, then we’re going to act tough because it’s in the interest of Polish farmers.”

Ukraine has sought alternative export routes for its grain after Russia blocked most shipments via the Black Sea shortly after its invasion last year. Some eastern European countries have since restricted grain imports from Ukraine, on grounds that the flows are undercutting their own farming sectors. The collapse in July of a deal to facilitate exports from the Black Sea has heightened tensions. 

Earlier this week, Ukrainian Deputy Economy Minister Taras Kachka warned that Kyiv will file a complaint at the World Trade Organization if Poland introduces a unilateral ban on Ukrainian grain. The government in Warsaw will still allow for the transit of Ukraine grain through its territory to the ports on the Baltic Sea or to be sold elsewhere in the EU.

The decision comes little more than a month before a parliamentary election in Poland on Oct. 15. Farmers are an important constituency for the ruling Law & Justice party, which is fighting to stay in power for a third term. The glut of grain imports on the domestic market sparked protests earlier this year.

Poland, Hungary and Slovakia have each pushed for an extension of the ban. Romania and Bulgaria have expressed more flexibility on the arrangements at EU-wide talks and avoided mentioning a potential unilateral ban. Hungarian Agriculture Minister Istvan Nagy is holding talks on the matter with his counterparts from Slovakia, Romania and Bulgaria, he said in a video on his Facebook page.

The European Commission — the EU’s executive arm — should extend restrictions on grain imports from Ukraine at least until the end of 2023, Nagy and his Romanian counterpart, Florin Barbu, said in a joint statement following their meeting Tuesday. 

Romanian farmers have threatened to block ports and border checkpoints used to aid the transit of Ukrainian grains if the ban isn’t extended.