Hungary joined Poland in announcing a halt in Ukrainian agricultural imports, saying that duty-free imports from its neighbor in the face of Russia’s invasion are putting Hungarian farmers at risk.

The suspension will be in effect until June 30 “in the absence of substantive EU measures,” the Agriculture Ministry in Budapest said in a statement. Poland halted imports of grain and some other food products from Ukraine to avert a “crisis of agriculture,” Jaroslaw Kaczynski, leader of the governing Law and Justice party, said earlier Saturday.

Poland and other neighbors of Ukraine had agreed to help get grain out of Ukraine and on to global markets after the Russian invasion blocked exports last year. That stance has been shifting as part of the supply is piling up in eastern Europe, triggering protests by Polish farmers this month. 

“If current market trends continued, that would cause serious damage to Hungarian agriculture,” Hungarian Agriculture Minister Istvan Nagy said in the statement. Ukraine’s lower-cost agriculture is undercutting Hungarian producers of poultry, eggs, honey, grain and oilseeds, he said.

Hungary called on the European Union to “consider the full duty-free treatment of Ukrainian goods and the functioning of the solidarity corridors.”

Poland “will keep on supporting Ukraine,” Kaczynski said at a rally on Saturday. “However, we have a duty to protect our citizens, farmers and avoid a crisis of our agriculture.”

The Polish government will conduct a purchase of grain from local farmers and provide additional subsidies for producers, while maintaining benefits for buying fertilizer, he said.

Ukraine’s Agriculture Ministry said the Polish decision violates an agreement reached last week in response to the protests, which stipulates that wheat, corn, sunflower seed and rapeseed from Ukraine can be shipped to Poland as long as it is then sent on to other countries by July. 

“We understand that Polish farmers are facing a difficult situation, but we are emphasizing, that now the most difficult situation is for Ukraine’s farmers,” the ministry said on its website. It proposed to reach a new accord with Poland in the coming days.