Prime Minister Justin Trudeau and his government have done as well as anyone could reasonably expect in negotiating a new economic deal with the United States and Mexico.

Canada (and Mexico) were always going to be playing defense in these talks, given the overwhelming size of the U.S. economy and the willingness of the Trump administration to use every kind of threat and bully tactic. In the end, for Canada, it came down to making a few acceptable concessions in order to keep the most important aspects of NAFTA in place and win guarantees in key areas, including autos and culture.

Most important, it avoids the truly troubling prospect of Canada being left on the sidelines as the U.S. and Mexico made a deal of their own. We've dodged that bullet, and it was a big one. It would have been an enormous political blow to the Trudeau government and, much more important, a real danger to a Canadian economy that for better or worse has been shaped for decades around easy access to the world's biggest and most dynamic market.

That being said, the new United States-Mexico-Canada Agreement falls short of the "win-win-win" deal that was promoted during the 13 months of talks. For one thing, it's notable that the words "free trade" appear nowhere in the new name. The very phrase has become synonymous with "lost jobs" in Rust Belt states that saw factory jobs migrate to Mexico under NAFTA. This is frankly about managed trade and political branding. Count that as a big win for President Donald Trump.

Canada did make a real concession in opening our dairy industry a bit more to U.S. producers. But that still amounts to giving the Americans access to only 3.6 percent of the Canadian market.

Weigh that against ending the threat of big tariffs against Canadian-made cars exported to the United States, and a ceiling on Canadian auto exports that is well above what Canada currently sends south of the border. That's a huge win for Canadian industry. No wonder the autoworkers' union is thrilled. Canada also bent on extending patent protections for pharmaceuticals, raising the prospect of higher drug prices. And most disappointingly, U.S. tariffs on steel and aluminum stay in place. They should have been removed as part of the deal.

Still, there are other gains for Canada. For one thing, Canadian workers stand to benefit from a major concession by Mexico, increasing guarantees for higher-wage workers in the auto industry. This was aimed at helping U.S. workers, but Canadians will win as well.

The threatened "sunset clause" won't be in the new deal, thanks also to Mexico's negotiators. Canada will keep important exemptions for cultural industries. And the new accord will include dispute settlement mechanisms that Canada had insisted on and the Americans wanted to dump. That was a red line that Canada had to maintain, and it did.

FROM AN EDITORIAL IN THE TORONTO STAR