TORONTO — Ray Laing followed the on-again, off-again negotiations to revamp NAFTA closely — and concluded he was on the losing end of the new deal.

He worries the agreement, which opens up more of Canada’s long-protected dairy market to the United States, will eat into demand for the roughly 660,000 gallons of milk produced each year at his Laingspring Farm in Steinbach, Manitoba.

But as representatives of Canada, Mexico and the United States signed the pact in Mexico City on Tuesday, Laing was willing to cut Canada’s negotiators some slack.

“This was the best of a bad situation,” he said from the farm that has employed five generations of his family.

The U.S.-Mexico-Canada Agreement, or USMCA, was greeted largely with a communal exhale here, not because it dramatically benefited Canada or modernized trade, but because the country averted worse outcomes, and many worried about its prospects in the midst of an impeachment inquiry. The deal remains to be ratified by the members.

The United States is Canada’s largest trading partner — roughly 75 percent of its exports flow to its southern neighbor — and uncertainty over the pact’s future rankled many. The Bank of Canada this month identified trade conflicts as the main risk to Canada’s economy.

“This negotiation has been an existential challenge for our country, and at times, an existential drama,” Deputy Prime Minister Chrystia Freeland said at the signing ceremony.

Canada had already scored small gains in the initial version of the USMCA last year. It won in its efforts to preserve the dispute settlement process in NAFTA’s Chapter 19, which allows the members to challenge one another’s countervailing and anti-dumping duties before a binational panel.

Under the most recent deal, which was revised to satisfy the demands of Democrats in Congress, Canada ticked off a few more items on its wish list.

Officials cheered the removal of a provision in last year’s agreement that would have extended patent protections for the special class of drugs called biologics to 10 years, increasing costs for Canadian patients. The United States agreed to end panel-blocking, which gave countries the ability to obstruct dispute settlement by refusing to appoint arbitrators.

“All of the new measures line up with Canada’s interests,” said Dan Ciuriak, a former deputy chief economist in Canada’s foreign affairs and trade department.

But not everyone is pleased.

Canada’s main concession in last year’s agreement was to give the United States slightly more access to its dairy market. It also agreed to end a pricing system that limited imports of the industrial milk ingredients known as Class 7 dairy products.

Canada’s politically influential dairy lobby has objected to the changes. Pierre Lampron, the president of the Dairy Farmers of Canada, described the agreement as a “sad chapter” for Canada’s dairy industry. “Would the U.S. ever accept such terms?” he asked.

The Canadian government said this year it would spend $1.31 billion over eight years to compensate dairy farmers for their losses.

“I think the government could have always done more,” Laing said. “But I’m not sure it had much of a choice.”

Canada’s aluminum industry is also a bit cross that Mexico agreed to tighten the automotive rules of origin for North American steel, but not for aluminum. Still, it urged lawmakers to ratify the deal because it offers “significant benefits” to the Canadian economy.

Prime Minister Justin Trudeau, campaigning for reelection this year, touted the trade pact as one of his key accomplishments. A Liberal Party campaign ad, narrated by Freeland, boasted that his government “stood up to Donald Trump on trade.”

Canada has said it will ratify the trade pact “in tandem” with the United States. Trudeau, whose government was reduced to a minority in the October election, will need the support of one other party to ratify the pact. He should get it, but a vote is not expected until the new year.

The deal capped what Freeland described as a “long, arduous, and at times, fraught negotiation.” President Trump levied tariffs on Canadian steel and aluminum, citing national security concerns. He called Trudeau “very dishonest & weak,” and threatened tariffs on Canadian autos.

“Given the size differential and the power disparity between the United States and the two other countries, it was a challenging negotiation,” said Drew Fagan, a professor of public policy at the University of Toronto. “We have never dealt with an administration like this one, but Canadians are both mild-mannered and forgiving, and this, too, shall pass.”

Freeland, speaking to reporters in Mexico City on Tuesday, spoke of the negotiations’ numerous “false dawns,” when it felt as if a deal was imminent, only for talks to stall.

“In the story of the boy who cried wolf, the wolf does eventually arrive,” she said.