BUENOS AIRES, Argentina -- Canada is confident it will win legal challenges to American steel and aluminum tariffs that remain despite the new NAFTA deal, Foreign Affairs Minister Chrystia Freeland said Friday in Buenos Aires following a high-profile signing ceremony for the trade treaty.

"We do not accept the legality of these tariffs," she said. "We have challenged and are continuing our legal challenges. We think this is simply wrong and frankly, we are very confident we are going to win those legal challenges."

Freeland's remarks offer a glimpse into the political and legal heavy lifting set to follow Friday's signing of the trade pact -- an agreement reached through hand-wringing negotiations and a ceremony confirmed only at the 11th hour.

U.S. President Donald Trump conceded Friday the process to reach the United-States-Mexico-Canada Agreement, or USMCA, was a battle but went on to say that "battles sometimes make great friendships."

Canadian officials had insisted Canada would not take part in a signing ceremony unless the steel and aluminum tariffs were lifted. Trump imposed them in June, ostensibly on the national-security grounds, and has refused to budge on them.

But Canada's refusal to sign the deal with the tariffs in place softened this week, said one insider: "At the end of the day, removing the uncertainty from the rest of the economy is too important to pass up."

In his remarks Friday, Prime Minister Justin Trudeau stressed the importance of locking down an agreement while he stood with Trump and outgoing Mexican President Enrique Pena Nieto.

Signing on to the three-way trade agreement alleviates the serious economic uncertainty that lingered throughout the negotiations, Trudeau said, adding uncertainty would have only caused more economic damage had the deal not been reached.

"There's much more work to do in lowering trade barriers and in fostering growth that benefits everyone," Trudeau said. "As a result (of the new agreement), the tariff-free access NAFTA guaranteed for more than 70 per cent of Canada's total exports is secure. That's essential for businesses, families, jobs, entrepreneurs, and hardworking people in every corner of our country. "

Trudeau raised the tariff issue with Trump before the three leaders emerged together for the signing ceremony, said officials in the Prime Minister's Office.

A Canadian official also said that the big advantage of signing onto the agreement now is a side letter on the auto industry, which exempts Canada from potential tariffs on exports of up to 2.6 million vehicles -- well above current levels.

Friday marked an important deadline for the trade pact because a new Mexican president takes over Saturday who might not honour the tentative deal struck by his predecessor.

Trump acknowledged that Friday was Pena Nieto's last day in office and congratulated him on the achievement of signing on to the deal.

The signing of the three-way trade pact is largely ceremonial because it still needs to be ratified by all three countries before it can formally take effect.

U.S. lawmakers have already indicated they don't expect to tackle the USMCA -- or CUSMA, as Ottawa now calls it, except when calling it the "new NAFTA" -- until after the new Congress is sworn in early next year.

The deal -- 32 chapters, 11 annexes and 12 side letters -- sets new rules for the auto sector, including a higher threshold for North American content and rules requiring that 40 per cent of car parts be made by workers paid at least $16 an hour.

It preserves a contentious dispute-resolution system the U.S. dearly wanted gone, extends patent protections for biologic drugs and allows U.S. farmers a 3.6-per-cent share of Canada's famously guarded market for poultry, eggs and dairy products -- a concession that dismayed Canadian dairy producers.

Earlier this month, a coalition of no fewer than 40 Republicans in Congress wrote to Trump urging him not to sign the agreement, expressing disdain for "inappropriate" and "insulting" language that commits the three countries to supporting and protecting sexual orientation and gender-identity rights.

Separately, a smaller group of Republican senators even tried to convince the White House to hit the gas pedal on ratification efforts, fearful that the new influx of Democrats in the new year will make congressional approval of the deal "significantly more difficult."

And just this week, Democrats whose regions were hit hard by deep job and production cuts at General Motors took their frustrations out on an agreement they thought was supposed to foster North American growth in the auto sector.

"If we're going to see more plants going to Mexico, I'm not going to support NAFTA 2.0," said Michigan Rep. Debbie Dingell. "These are peoples' lives; these are people who work in my district and I'm working hard to keep those jobs here."