Minnesotans have reason for cheer — or, at least, for relief — after President Donald Trump and the U.S. House reached accord on a new trade treaty between the three largest nations of North America.

Tens of thousands of workers across the state, from field to factory, have something to gain in the United States-Mexico-Canada Agreement (USMCA), which the Senate is expected to approve next month. They also would have had much to lose if the pact did not go forward. A president who portrays himself as a master negotiator has struggled to work out trade deals with China, Latin America and Europe.

But after Senate passage, Trump is expected to sign a deal that promises to smooth trade frictions with Canada and Mexico — Minnesota's two largest trading partners. A favorable vote from Congress is expected early next year. As Democrats and Republicans alike elbow their way before cameras to take credit, it's worth sorting the winners and losers.

The stakes for Minnesota are high across a wide array of industries, which in the third quarter of 2019 exported more than $1.2 billion to Canada and nearly $660 million to Mexico. At last count, Minnesota's agricultural exports ranked fourth-highest in the nation. The goods range from soybeans and corn to feeds and pork. But, lately, Minnesota farmers have suffered in a tariff war that's dramatically slowed exports, chiefly to China.

USMCA promises, at the very least, to avert rising trade barriers to Minnesota farm products in markets closer to home. Leaders of companies and labor unions could claim victories, as well.

Business leaders had warned that uncertainty in trade arrangements could reduce investment in the U.S., Mexico and Canada. Minnesota-based multinationals, such as 3M, Toro and Donaldson, for years have hopscotched across borders sprinkling manufacturing, design and marketing in locations across a wide map. Smaller companies have followed.

Many times, the apparent result is a loss of U.S. manufacturing jobs. Often overlooked: Many parts makers in Minnesota are feeding assembly plants in Canada and Mexico, making products that might not exist without low-cost manufacturing.

Labor unions won provisions to force Mexico to trod a more even playing field in employee pay and working conditions. The provisions promise to create 176,000 new U.S. jobs by slowing the shift to cheaper labor across the border. Canada, meanwhile, agreed to ease restrictions on butter and cheese imports — a longtime point of conflict with dairy farmers in Minnesota and across the nation.

While USMCA reflects only incremental changes in the quarter-century-old North American Free Trade Agreement, the deal marks an important achievement: It will prevent Trump from tearing up NAFTA and creating economic bedlam. And the deal leaves one big loser that may make winners of most Americans: Pharmaceutical makers lost a provision that would have allowed them to extend patents (read: government-protected monopolies) on selected drugs for 10 years in Mexico and Canada.

That plan would have raised drug prices across the U.S. border, even as politicians at home grapple with Big Pharma price-gouging — a timely issue in Minnesota and across the land. All said, USMCA delivers at least a small dose of good medicine for what ails the sick — and international trade.