BUENOS AIRES (Reuters) - The United States, Canada and Mexico signed a North American trade pact on Friday, with President Donald Trump brushing aside concerns that he could face difficulties getting the deal through the U.S. Congress.

The leaders of the three countries agreed on a deal in principle to replace the North American Free Trade Agreement (NAFTA), which governs more than $1.2 trillion of mutual trade, after acrimonious negotiations concluded on Sept. 30.

Friday’s signing potentially ends a big source of irritation for the U.S. administration as it pivots to a much bigger trade fight with China that threatens the global economy. All eyes are on a meeting between Trump and Chinese President Xi Jinping on Saturday after a G20 summit in Buenos Aires.

Trump had vowed to revamp NAFTA during his 2016 presidential election campaign. He threatened to tear it up and withdraw the United States completely at times during the negotiation, which would have left trade between the three neighbors in disarray.

The three were still bickering over the finer points of the deal just hours before officials were due to sit down and sign it.

“It’s been long and hard. We’ve taken a lot of barbs and a little abuse and we got there,” Trump said after the signing.

Canadian Prime Minister Justin Trudeau still had a few barbs of his own on Friday. He called the deal by its old name NAFTA, prodded Trump over U.S. steel and aluminum tariffs, and said General Motors Co’s (GM.N) decision to cut production and slash its North American workforce, including in Canada, was a “heavy blow.”

“Donald, it’s all the more reason why we need to keep working to remove the tariffs on steel and aluminum between our two countries,” Trudeau said.

Mexico’s outgoing President Enrique Pena Nieto was warmer. On his last day in office, he said the new deal was forged with the “firm belief that together we are stronger and more competitive.”

Legislators from the three countries must still approve the pact, officially known as the United States-Mexico-Canada Agreement (USMCA), before it goes into effect and replaces NAFTA.

But the U.S. landscape will shift significantly in January when Democrats take control of the House of Representatives, after winning midterm elections in November.

Presumptive incoming Speaker of the House Nancy Pelosi described the deal as a “work in progress” that lacks worker and environment protections.

“This is not something where we have a piece of paper we can say yes or no to,” she said at a news conference on Friday, noting that Mexico had yet to pass a law on wages and working conditions.

Other Democrats, backed by unions that oppose the pact, have called for stronger enforcement provisions for new labor and environmental standards, arguing that USMCA’s state-to-state dispute settlement mechanism is too weak.

“There is still a ways to go to gain support in the new Congress for this agreement,” said Representative Bill Pascrell, the top Democrat on the House Ways and Means trade subcommittee.

Still, Trump and U.S. Trade Representative Robert Lighthizer expressed confidence that the NAFTA replacement would pass Congress.

“It’s been so well reviewed I don’t expect to have very much of a problem,” Trump said.

Lighthizer said the pact was negotiated from the beginning to be a bipartisan agreement. “I think we’ll get the support of a lot of Democrats,” he told reporters.

Trump had forced Canada and Mexico to renegotiate the 24-year-old agreement because he said the existing pact encouraged U.S. companies to move jobs to low-wage Mexico.

U.S. objections to Canada’s protected internal market for dairy products was a major challenge facing negotiators during the talks, and Trump repeatedly demanded concessions and accused Canada of hurting U.S. farmers.

Matt Blunt, the head of the main lobbying group for GM, Ford (F.N) and Fiat-Chrysler (FCHA.MI), applauded the deal, saying it would keep north American automotive manufacturing competitive and included a first-ever provision to address currency manipulation.

“However, we remain concerned that the continued imposition of steel and aluminum tariffs on Canada and Mexico will undermine the benefits of the USMCA,” added Blunt, who heads the American Automotive Policy Council.

Slideshow (5 Images)

Foreign brand automakers have expressed concerns that the new rules of origin, which require more high-value content be produced in the United States or Canada, will be too burdensome.

BDI, Germany’s main industry association, said in a statement that the autos rules of origin were “a retrograde step compared with NAFTA.”

Reporting by Roberta Rampton, Matt Spetalnick and Caroline Stauffer in Buenos Aires and David Ljunggren in Ottawa; Additional reporting by David Lawder, Richard Cowan and Lisa Lambert in Washington; Editing by Susan Thomas and Rosalba O'Brien