In case you were thinking our dreary politics no longer have the capacity to surprise, consider that somehow, amid a presidential impeachment inquiry, our extremely divided, dysfunctional government agreed on a trade deal that is better than the one it’s replacing.

I’m talking about the USMCA (U.S.-Mexico-Canada Agreement). After months of negotiations between Democrats and the Trump administration’s trade representative, Robert E. Lighthizer, there’s an agreement among the United States, Mexico, Canada, Democrats and Republicans. Though a Mexican foreign minister just raised objections to one of the enforcement aspects of the deal, he’s probably too late to make a difference. Look for the House to approve the USMCA before year’s end and the Senate to pass it early next year.

What I think is most important about the deal is that it debunks the myth that progressive Democrats are anti-trade protectionists. As I’ve often stressed, our goal is not to block trade flows. It’s to change the rules of the road so trading relationships benefit workers.

Politically, some on the left argued that giving President Trump a win on the USMCA would be a huge mistake. By making a deal with Trump on one of his key issues — he ran on replacing the North American Free Trade Agreement (NAFTA) — Democrats allow him a victory lap and undermine their charges that he’s an incompetent leader. As the progressive strategist Rebecca Katz put it, “If you are calling a president illegitimate and corrupt, you can’t then give him the big wins that he will need when he goes into key states.”

Such claims have merit, but they must be weighed against two counterarguments. First, if Democrats had blocked the deal rather than forcing its renegotiation, Trump still would have touted a perfect NAFTA fix while claiming Democrats were denying working Americans its benefits. Second, Trump’s initial USMCA deal was rigged for Big Pharma. By forcing its renegotiation, Democrats can spotlight how Trump betrayed his promise to renegotiate NAFTA on behalf of working people.

Another compelling piece of evidence that Democrats were able to move the negotiations to the left is the endorsement of the USMCA by the AFL-CIO, the largest federation of unions in the nation. The AFL-CIO has vehemently opposed almost every significant trade deal since NAFTA, but after playing an active role in the USMCA negotiations and forcing labor standards and enforcement improvements in Trump’s 2018 deal, they told their members, “We have secured an agreement that working people can proudly support.”

Does the substance of the deal support this claim? In many ways, it does.

The most important improvement — the one for which workers’ advocates fought for hardest — is the facility-specific labor enforcement measures, because without those, the improved labor standards mean nothing. For the first time in any trade agreement, tariffs and fines can be imposed against specific products produced in facilities that are determined to deny workers collective-bargaining rights. If there are repeated violations, goods can be blocked at the border.

The next most important improvements are two policies that were cut as part of the deal. The first was NAFTA’s biased Investor-State Dispute Settlement regime, a process for settling investor disputes that undermined sovereign public-interest policies while incentivizing outsourcing. Also eliminated were extended patent protections pushed by American pharmaceutical corporations and congressional Republicans. Had such protections stayed in the deal, they would have made it more difficult for us to legislate our own much-needed policies against excessive drug pricing.

Other improvements include beefed-up rules of origin designed to avert favored treatment for goods mostly produced outside the USMCA zone, and improved labor and environmental standards, including the elimination of terms that thwarted conservation measures by requiring countries to export natural resources.

None of these improvements will solve the long-term problem of the globalization-induced loss of U.S. jobs. As Public Citizen’s Lori Wallach, a fighter for fairer trade for decades, put it: “Trump’s claim that this new NAFTA will bring back hundreds of thousands of manufacturing jobs is absurd. However, over time, the labor and environmental standards and enhanced enforcement terms may help raise wages in Mexico, and this may also reduce U.S. corporations’ incentives to outsource U.S. jobs to Mexico to pay workers less.”

Perhaps the most important aspect of the deal is what it says about trade agreements going forward. Before NAFTA, trade deals were largely negotiated with the input of a narrow set of corporate interests. Pundits and most economists supported the deals sight unseen — most still do so — because they thought they were solely about increasing trade, which was viewed as pro-growth, full stop. (In bragging about his support for a trade agreement, New York Times columnist Thomas Friedman once said that he “didn’t even know what was in it. I just knew two words: free trade.”)

The thing is, once you learn what’s in these deals, you quickly realize that there is no such thing as “free trade.” In reality, modern trade deals enumerate a complex set of rules by which countries will engage in commerce. NAFTA incentivized outsourcing by providing cost-free risk insurance for foreign investors, set ceilings on the levels of food and product safety, and embedded and extended cost-distorting patent arrangements among the partners to the deal.

Yes, countries need trade to be organized through rules of the road in the same way drivers do. But the rules are not impartial; they create winners and losers. So it matters who makes them. Democrats such as former congressman Sander M. Levin, Reps. Rosa L. DeLauro and Jan Schakowsky and Sens. Sherrod Brown, Elizabeth Warren and Bernie Sanders, along with many others, fought to reshape the rules, and the USMCA is the first deal to at least partially reflect their efforts.

This belies the claim that these Democrats were pure protectionists — a claim that was always ironic, as alleged “free traders” kept putting protections for favored industries, such as pharma, in the deals. The USMCA shows that fair-trade Democrats can and will take yes for an answer. The problem was that previous negotiators highhanded those trying to help craft rules that went beyond just protecting investors and favored industries.

In other words, the forward-looking lesson of the USMCA is that respecting pro-worker, pro-union voices doesn’t break the deal. It makes the deal.