Cooler heads prevailed in heated trade talks between the U.S. and Mexico -- for now.
The two nations reached an agreement on Tuesday regarding Mexican sugar exported to the United States.
The agreement was seen as a test for both sides before they sit down for much bigger talks on NAFTA, the free trade deal between the U.S., Mexico and Canada. Those talks could begin in August.
President Trump wants to renegotiate NAFTA because he says it's responsible for the loss of millions of American manufacturing jobs to Mexico. Supporters across the political spectrum say NAFTA is a job creator.
The sugar agreement helps both countries avoid a potential trade war. The U.S. might have applied tariffs on Mexican sugar imports, while Mexico could have retaliated with tariffs on U.S. corn syrup.
"I'm glad to say that Minister Guajardo and his colleagues have been honest and collaborative partners in seeking a fair and sustainable solution," Commerce Secretary Wilbur Ross said Tuesday, referring to Mexico's economic minister, Ildefonso Guajardo.
Under the deal, Mexico agreed to export far less refined sugar to the U.S. American sugar refineries argued for years that the exports were unfairly priced too low because the Mexican government subsidizes sugar production.
At the same time, the deal allows for an increase in exports of raw sugar from Mexico. Mexican raw sugar producers are one of the biggest providers to U.S. sugar refineries, which complained of a shortage of raw sugar to make sweeteners used for beverages and food products.
Related: NAFTA talks can start August 16, Trump team says
Additionally, if the U.S. Department of Agriculture finds that U.S. firms need more imported sugar in any given year -- raw or refined -- it must first offer to buy Mexican sugar.
Trade experts say Ross sent Mexico an olive branch Monday when he decided to extend a negotiating deadline by 24 hours to finish up final details. If the deadline passed, both sides risked tariffs.
That willingness to work things out could be a good sign for NAFTA talks later this year.
American sugar industry advocates were split. Sugar refiners lauded the agreement but Ross conceded that others, likely raw sugar producers, told him they would not support the deal.
Mexico's chamber for sugar producers didn't immediately respond to a request for comment.
U.S. Agriculture Secretary Sonny Perdue says the agreement "sets an important tone of good faith leading up to the renegotiation of the North American Free Trade Agreement."