Poland and three other EU member states are to lift a ban on imports of Ukrainian foodstuffs under a deal reached with Brussels on Friday.
The unilateral measures had raised tensions with other member states who accused Poland, Hungary, Slovakia and Bulgaria of deserting Kyiv in its hour of need as it fights Russian aggression.
The European Commission will impose temporary curbs on a more limited range of products, accepting that a glut of grain in the countries has caused hardship for their farmers.
The measures will also cover Romania which had also complained about low grain prices as its warehouses filled with Ukrainian imports. However, it had not taken unilateral action. They are expected to take effect in the coming weeks.
Wheat, maize, oilseed and sunflower seed will only be allowed into those countries if they are in transit to other destinations.
Valdis Dombrovskis, EU trade commissioner, announced the deal on Friday evening.
“The neighbouring member states will be withdrawing their unilateral measures,” he said. “We have a solution which addresses the concerns both of farmers in neighbouring member states and of Ukraine.”
The commission will also investigate whether the curbs should be extended to other commodities such as eggs and meat.
Brussels acted swiftly after some of Ukraine’s most loyal allies took the steps because of protests by farmers.
The five countries will receive €100mn from EU funds to compensate farmers.
The EU dropped tariffs and quotas on foodstuffs from Ukraine, an agricultural powerhouse, to assist it after the Russian invasion. However, much of the Ukrainian grain entering the bloc had remained in bordering countries because of the high cost of transporting it to traditional markets such as Africa.
The unexpected success of a deal with Russia and Turkey to export grain via the Black Sea has also diminished demand for land routes set up by the EU.
EU member states agreed as well on Friday to extend the wartime trade regime with Ukraine for another year, until June 2024. A revised version will have stronger provisions that allow the EU to take measures to “safeguard” its own market more rapidly in future.
Brussels also promised to help organise convoys of trucks, trains and barges to transport the grain to ports where it can be sent to countries in need.