Poland and four other European Union member states agreed to restrictions on Ukrainian grain products as part of an agreement with the bloc’s executive arm, replacing their unilateral bans on imports in response to plummeting prices. 

The measures apply to wheat, corn, rapeseed, sunflower and sunflower oil — and will be in place until June 5, with the possibility of being extended through the end of the year, Agriculture Commissioner Janusz Wojciechowski told reporters in Warsaw Friday. The transit of Ukrainian foodstuffs to other member states will continue, he said. 

Poland, Hungary, Slovakia and Bulgaria imposed bans earlier this month, arguing a glut of grain stoked by a flood of Ukrainian imports was threatening the livelihood of their farmers. Romania had held off from imposing a ban but said it would adopt restrictions as part of a broader EU deal. 

A farmer and union member inspects a silo storing unsold grain on a farm in Sedziejowo, Poland, April 17.

The moves drew a rebuke from the EU, which said it potentially violated the bloc’s trade policy. While the transit of Ukrainian grain has added to pressure on logistics in eastern Europe, global grain prices have fallen due to big harvests in major producers like Russia and Australia.

Farmers are a key voter base for political parties in Poland ahead of October elections. The ban came as a surprise, since Poland has been among the staunchest supporters of Ukraine since it was attacked by Russia last year.