WARSAW, Poland >> Slovakia became the third European Union country to ban food imports from Ukraine on Monday, deepening the challenge for the bloc as it works to help Ukraine transport its grain to world markets.

Slovakia followed Poland and Hungary, both of which announced bans Saturday on Ukrainian food imports through June 30. They did so in response to rising anger from farmers who say that a glut of grain in their countries is causing them economic hardship.

The EU’s executive branch, the European Commission, manages trade on behalf of the 27 member countries and objects to them taking unilateral or uncoordinated measures.

At a briefing in Brussels, two spokespeople stressed gratitude to Poland and other Central European countries for supporting Ukraine, but said a solution must be found that respects the EU legal framework.

“We are dealing with a war, right? And this war has consequences, obviously, on farmers and more generally, the population in Ukraine and the European Union and its member states,” said Eric Mamer, chief spokesperson.

He acknowledged that Poland and other countries “have been doing their utmost in order to help Ukraine, adding: “So this is not about sanctioning. This is about finding solutions based on EU law in the interests at the same time of the Ukrainians and of the EU.”

EU countries that neighbor Ukraine have asked the EU to treat the matter of Ukrainian food with urgency, saying they can’t allow their own farmers to bear the cost of disruption that Ukrainian agriculture products are causing to their markets.

A delegation of Ukrainian officials visited Warsaw on Monday for government consultations on the issue. Poland faces an election in the fall and farmer groups have been protesting to urge action.

Hungary’s agriculture minister, Istvan Nagy, said the surge in Ukrainian products on European markets had made it impossible for Hungarian farmers to remain competitive.