MEXICO CITY (Reuters) - The U.S. and Mexican governments reached a deal in a dispute over trade in sugar on Monday, sources said, averting steep U.S. duties and Mexican retaliation by Mexico on imports of American high-fructose corn syrup ahead of the renegotiation of NAFTA.

Slideshow ( 2 images )

Two sources, speaking on condition of anonymity, said the two sides were working on final details of a deal in Washington that would end a year of wrangling. The latest talks began in March, two months after President Donald Trump took power vowing a tougher line on trade to protect U.S. industry and jobs.

They are seen as a precursor as well as significant hurdle to the more complex discussions on the North American Free Trade Agreement between the United States, Mexico and Canada, which are expected to start in August.

One source said the sugar deal would benefit both the United States and Mexico, with another saying Mexico will agree to export less refined sugar and send a lower quality of crude sugar to the United States than it previously did.

Both sides also would avoid potentially inflammatory tariffs that could have kicked in if a deal was not reached.

Some members of the U.S. sugar industry, however, are not happy with the reported deal and were pressuring the Trump administration to stop it, one source said. Some of their Mexican counterparts also expressed anger at what they see as unfavorable terms.

ICE U.S. domestic raw sugar futures for July delivery SFSc1 finished down 2.9 percent at 27.66 cents per lb, in the largest one-day loss in over a year.

The risk that failure to reach a deal would a trigger a rapidly escalating tariff battle ahead of the NAFTA talks added pressure to Mexico to reach a deal.

“If it had melted down, the NAFTA conversation would have been more difficult,” said Daniel Pearson, a senior fellow at the conservative think-tank Cato Institute and a former chairman of the U.S. International Trade Commission.

“The fact that an agreement could be reached on a sensitive topic like (sugar) bodes well for dealing with sensitive talks in NAFTA,” he said.

U.S. Commerce Secretary Wilbur Ross came close to hammering out a compromise deal before an earlier deadline in May, but it fell through as the U.S. sugar lobby upped its pressure on U.S. lawmakers, said two sources familiar with the talks.

The powerful lobby includes the politically connected Fanjul family, Imperial Sugar Co [LOUDRI.UL], owned by Louis Dreyfus Co, and U.S. cane and beet growers.

Mexico had free access to the U.S. sugar market under NAFTA, but U.S. sugar refiners accused it of dumping subsidized sugar, undercutting their businesses. In retaliation, the United States slapped large duties on the Mexican sweetener, but a 2014 agreement suspended the tariffs in return for quotas and price floors for Mexican sugar.

The new deal would lower the proportion of refined sugar Mexico can export to the United States to 30 percent of total exports, from 53 percent, one source said. It also cuts the quality of Mexico’s crude sugar exports to 99.2 percent, from 99.5 percent, the source said, tackling a key complaint of U.S. refiners, who said Mexican crude sugar was close to refined and going straight to consumers.

The U.S. sugar market is protected by a complex web of price supports and import quotas, which confection makers and other critics say artificially inflates domestic prices. NAFTA opened the doors to Mexican sugar in 2008.