MEXICO CITY (Reuters) - Mexican tomato producers struck a last-minute agreement with the Trump administration to avert an anti-dumping investigation and end a tariff dispute that has rumbled on for months, government officials said on Wednesday.

Slideshow ( 5 images )

Under the draft accord with the U.S. Commerce Department, the majority of Mexican tomato exports will be subject to U.S. border inspections, and specialty tomatoes face higher reference prices on the American marketplace.

Mexican Economy Minister Graciela Marquez said on Twitter the accord kept the U.S. market open for exporters, while the Commerce Department said it “has enforcement provisions that completely eliminate the injurious effects of Mexican tomatoes, as well as price suppression and undercutting.”

Mexican President Andres Manuel Lopez Obrador, whose relations with the Trump administration have been fraught by tensions over trade and immigration, hailed the agreement as “very good news” during his regular news conference.

Disputes between the United States and Mexico over tomatoes have gone on for years, predating U.S. President Donald Trump’s time in office.

Mexican tomato growers had been negotiating for a deal since May, when Washington imposed a 17.5% tariff on Mexican tomatoes after the sides failed to renew an earlier agreement.

Economy minister Marquez said the agreement was reached shortly before midnight on Aug. 20. This allowed for a 30-day comment period before a Sept. 19 Commerce Department deadline for completing its anti-dumping investigation.

Several Mexican growers groups said in a statement that the accord included a “controversial proposal” to allow quality-control inspections on 92% of exports at the U.S. border.

However, the U.S. Commerce Department said in a statement that figure was inaccurate because it included tomatoes on the vine, which are excluded from the border inspection requirement. “Commerce estimates that the correct figure is 66%,” it said.

This month, the Mexican government had rejected as “totally unacceptable” a proposal to subject all tomato exports from Mexico to border inspections.

The Commerce Department said the deal closed “loopholes” from past suspension accords that enabled sales below the reference prices, and that it could now audit “up to 80 Mexican tomato producers per quarter, or more with good cause.”

Under the agreement, which faces its next review by September 2024, the reference price of specialty tomatoes will rise, and the price of organic tomatoes will increase by 40% above that of conventional ones, the Mexican growers said.

The U.S. Commerce Department said the deal sets reference prices for rounds and romas at 31 cents per lb., stem-on tomatoes at 46 cents per lb., tomatoes on the vine at 50 cents per lb., specialty loose tomatoes at 49 cents per lb., and specialty packed tomatoes at 59 cents per lb.

The last bilateral agreement was brokered in 2013, and U.S. tomato growers, particularly in Florida, pressed Trump to terminate it, complaining that it contained loopholes that allowed Mexican growers to dump tomatoes on the U.S. market.

According to the Mexican government, there are some 1.5 million tomato growers in Mexico, and exports of the product to the United States are worth around $2 billion annually.