BUENOS AIRES, Argentina – President Donald Trump and the leaders of Mexico and Canada signed a revised trade pact Friday that changes many of the rules governing the free flow of commercial goods across North America.

The ceremony, held on the first day of the G-20 summit here, brought the three countries a step closer to their goal of improving continental commerce and making it easier for companies to move goods and supplies across their borders.

"This has been a battle, and battles sometimes make great friendships," Trump said. "This is a model agreement that changes the trade landscape forever."

But many other steps will be needed before the new agreement takes effect.

“There’s still a lot of work to do on this deal before we hit the finish line,” said Daniel Ujczo, an international trade attorney in Ohio.

The United States-Mexico-Canada Agreement, announced with fanfare by the leaders of all three countries in late September after months of on-again, off-again negotiations, will replace the 24-year-old North American Free Trade Agreement. That agreement, known as NAFTA, essentially eliminated tariffs on most goods traded among the three countries.

Trump, Mexican President Enrique Peña Nieto and Canadian Prime Minister Justin Trudeau have all lauded the new pact as good for their countries’ economy and for workers. All three took part in Friday morning's signing ceremony.

But the agreement still must be ratified by the legislative bodies of all three countries – a process that could take months and could be complicated by the Trump administration’s tariffs on aluminum and steel and by the House Democrats’ return to power in January.

"We need to remove the tariffs on steel and aluminum between our two countries," Trudeau said.

Trudeau, who has had a rocky relationship with Trump, described the agreement as the "new NAFTA." Trump, who ran for president on a promise to tear up that controversial 1994 deal, has instead embraced the acronym "USMCA."

Mexico is expected to go first. Mexico’s incoming president, Andres Manuel López Obrador, will take office Saturday. The Mexican Senate is expected to ratify the trade pact quickly so the new administration can focus on its domestic agenda.

In Canada, where the agreement has been met with skepticism by dairy farmers and others, Parliament is unlikely to take up the pact until after it is ratified by the U.S. Congress.

A vote in Congress probably won’t happen before next March or April and could possibly be delayed as late as next fall, said Ujczo, who works for the law firm of Dickinson Wright and closely followed trade talks of the three countries.

Trump said the agreement had already been heavily reviewed by lawmakers.

"I don’t expect to have much of a problem," Trump said.

Later, he took to Twitter to boast about the deal.

"Just signed one of the most important, and largest, Trade Deals in U.S. and World History," he wrote. "The United States, Mexico and Canada worked so well together in crafting this great document. The terrible NAFTA will soon be gone. The USMCA will be fantastic for all!"

The U.S. International Trade Commission will release its report on the trade deal’s impact on the economy early next year, probably in March. Congress will almost certainly wait for that report before scheduling a vote on the deal, analysts said.

House Democrats’ return to power in January could slow the ratification process further. The new agreement includes some policies embraced by Democrats, including stronger labor and environmental provisions. But critics have complained those provisions don’t go far enough and are filled with too many loopholes.

Though trade deals are usually subject to an up-or-down vote with no amendments, Congress still would have to pass legislation to implement the agreement. House Democrats could use that legislation as the vehicle to try to strengthen the labor and environmental provisions or extract concessions from the Trump administration on unrelated issues.

If trade officials work with congressional Democrats, unions and others to make needed improvements, “a final deal could achieve broad support next year,” said Lori Wallach, director of Public Citizens’ Global Trade Watch.

“Of course,” she said, “who knows what lunatic things unrelated to trade that Donald Trump might do in the meantime to derail that prospect.”

Fearing that passage will become more difficult in 2019, a dozen Senate Republicans, led by Sen. Pat Toomey, R-Pa., sent a letter to Trump last week urging him to push for a ratification vote before Congress adjourns this year.

“We believe the best time to do it is this Congress before Democrats take over in the House,” said Sen. Lamar Alexander, R-Tennessee, who signed the letter. “At the same time, I want to work with the president to make sure that this new trade agreement brings an end to steel and aluminum tariffs among the United States, Canada and Mexico.”

Senate Majority Leader Mitch McConnell, R-Ky., said in October the Senate does not have time to vote on the new agreement this year and would have to vote on it in 2019. His office did not respond Thursday to questions about whether he plans to stick to that timeline.

Canada’s Parliament will ratify the agreement, but probably not until after Congress approves it, said Clifford Sosnow, an Ottawa-based attorney for the law firm Fasken and who specializes in international trade.

“There’s absolutely no enthusiasm for Canada to be seen ahead of the curve in ratifying something that Congress is having difficulty with,” Sosnow said.

With each passing day, Sosnow said, Canadians like the agreement less and less and grow concerned that they’re giving up more than they are getting under the deal. Canada’s dairy farmers feel they are being unfairly whacked by new rules that will give U.S. producers more access to the Canadian market. Trump’s tariffs on steel and aluminum also remain a sore point for Canadians, Sosnow said.

“It hasn’t been a great deal for Canada,” he said.

All three countries will probably have a difficult time ratifying the deal as long as the steel and aluminum tariffs are in place, Ujczo said.

More:Food fight: Trade deal between Mexico, European Union creates stink for U.S. cheese makers

More:New trade deal with Canada, Mexico borrows heavily from pact that Trump abandoned

More:Friends again, eh? Canadians aren't ready to forgive Donald Trump's insults during trade talks

Contributing: John Fritze