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.

Under the draft accord with the U.S. Commerce Department, the vast 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."