TORONTO -- U.S. President Donald Trump vowed to make Canada pay after Prime Minister Justin Trudeau said he wouldn't be bullied in trade talks. Trump called Trudeau "weak" and "dishonest." He threatened tariffs on cars and slapped them on steel.

The unprecedented attacks on America's closest ally left a bitter taste. But Canadians mostly feel relieved after reaching a new trade agreement with Trump. Many said it could have been a lot worse. Canada avoided auto tariffs and maintained access to the all-important American market.

The U.S. made few, if any concessions, while Canada provided more access to its dairy sector and allowed Washington to possibly prevent Canada from reaching a free trade deal with China. Canada also was not able to remove steel and aluminum tariffs.

"We were definitely over the barrel in this negotiation," said Peter MacKay, a former Canadian foreign minister. "We have survived it. We have survived the 14 roller coaster months of a very unpredictable president."

About 75 per cent of Canada's exports go to the U.S., so preserving major elements of the North American Free Trade Agreement was crucial. Canada is one of the most trade-dependent countries in the world and Trump's talk of ripping up that deal and imposing a 25 per cent tariff on the auto sector posed a serious economic threat.

"We didn't ask to reopen NAFTA. We were dragged into it and we dealt with it the best we could," said Jean Charest, a former Quebec premier.

"We were always on the defensive. We always knew from the outset that we weren't going to be making spectacular gains. We limited the damage and preserved our access to the American market."

Foreign Minister Chrystia Freeland, Canada's chief negotiator, called it a victory because it maintains tariff-free access to the U.S. for most of the country's exports. The Trump administration's most contentious demands like its insistence that 50 per cent of autos imports be American-made were dropped. Canada also kept at NAFTA dispute-resolution process that the U.S. wanted to jettison.

"The most important gain from this agreement is retaining our access to the U.S. market and Canadians understand that," Freeland said.

But there is a widely shared belief that Canada made concessions and the U.S. did not.

"The concessions were all from Canada and Mexico," MacKay said. "All of them. The only thing that the United States gave up was more demands."

Robert Bothwell, a professor at the University of Toronto, also said the U.S. just reduced their initial demands.

"The deal is not a disaster," Bothwell said. "People will accept it with resignation rather than joy. I trust when the Canadian signs he'll just wash his hands afterward."

Roland Paris, a former foreign policy adviser to Trudeau, expressed relief that the deal is done but worried about the long-term relationship between the two countries.

"Canadians won't forget Trump's disgraceful treatment of Canada. Our economic partnership has been reaffirmed, but trust can't be rebuilt with the stroke of a pen," Paris tweeted.

The agreement reached Sunday shows a give-and-take between the two countries: It gives U.S. farmers slightly greater access to the Canadian dairy market, but provides Canada protection if Trump goes ahead with plans to impose tariffs on cars and auto parts imported into the U.S.

Canada could have lost 60,000 jobs in a trade war and taken a 1 percentage per cent hit to its GDP -- a significant drop because Canada's economy is projected to grow just 2 per cent next year, according to estimates from the C.D. Howe Institute, a Toronto-based think-tank .

Ontario's auto industry faced the biggest threat, but the sector welcomed the new agreement. The deal requires that 40 to 45 per cent of a car's content be built where workers earn $16 an hour. That is meant to bring production back to the United States or Canada and away from Mexico, where auto workers earn on average just $4 to $5 an hour.

Jerry Dias, president of Canada's largest private-sector union, Unifor, said he was thrilled the auto tariff threat has been lifted.

The agreement also potentially restricts Canada and Mexico from reaching a free trade agreement with China and other "non-market" countries. If Canada or Mexico signed a deal with China, the U.S. could terminate its trade agreement with Canada or Mexico on a six-month notice. That may pose a problem for Canada which is eager to diversify its trade.

"It's bizarre," Charest, the former Quebec premier, said. "I have never seen anything like that in a trade agreement."

Daniel Ujczo, a trade attorney with the Dickinson Wright law firm, said Canada and Mexico also must give the U.S. notice before starting those trade discussions and updates of all proposals made during the negotiations.

"The clause achieves a key policy imperative for the US; namely, shutting China's backdoor to North America through Canada and Mexico," Ujczo said. "Japan and Europe, as well as the rest of the world, should be on notice that this may be the price of admission to a trade deal with the U.S."

The U.S. also pressured Canada and Mexico to raise the duty-free limit on imported goods. Canada, for instance, will allow tax- and duty-free shipments worth up to 40 Canadian dollars (about $31), up from 20 Canadian dollars ($16) under NAFTA. The U.S. wanted a higher figure. Store owners like Larry Rosen, chief executive of men's clothing chain Harry Rosen, feared it would drive customers to larger U.S.-based online competitors.

"I am relieved," Rosen said. "It could have been much worse."

Like many other Canadians, Rosen feels Canada hasn't been treated with respect, referring to the personal attacks and steel exports that are still subject to U.S. tariffs over what Trump calls national security concerns.

"I am a Canadian. I am polite and respectful. Even when I'm dealing with a hard business issue I don't belittle people, I don't insult them," Rosen said. "As a Canadian, the whole approach that has been taken (by the U.S.) has been offensive and I don't think Canadians will forget it."

Trump said last week he didn't like Canada's trade negotiator in an apparent reference to Freeland. And, at one point, Trump's trade adviser Peter Navarro said there was "a special place in hell" for Trudeau.

"It has been shocking and disappointing and upsetting," said Bruce Heyman, a former U.S. ambassador to Canada. "It has been traumatic. I just don't think it gets wiped away and resolved with an agreement in principle on the trade agreement."

Trump's mistreatment reinforces a worry among Canadians that their much larger neighbour is taking advantage of Canada, Heyman added.

Bothwell, the University of Toronto professor, warned of lingering damage to relations.

"Trump treated it like a real estate deal when he was a shyster in Atlantic City," Bothwell said.

"But this is nation to nation. And that's different. And it's connected to other things," he added. "Trump really doesn't grasp that and doesn't care."