A new US trade pact with Canada and Mexico is “a great deal” for all three countries, President Donald Trump said on Monday, hailing the replacement of the old NAFTA deal which he had long railed against and threatened to cancel. “Late last night, our deadline, we reached a wonderful new Trade Deal with Canada, to be added into the deal already reached with Mexico,” Trump said on Twitter. “It is a great deal for all three countries.” The new pact known as the United States-Mexico-Canada Agreement (USMCA) “solves the many deficiencies and mistakes” in the 24-year-old North American Free Trade Agreement it replaces, Trump said after accomplishing one of his signature policy initiatives. USMCA “greatly opens markets to our Farmers and Manufacturers” while reducing trade barriers “and will bring all three Great Nations closer together in competition with the rest of the world. The USMCA is a historic transaction!” the president said. The rewritten deal “will result in freer markets, fairer trade and robust economic growth in our region,” a joint statement from US Trade Representative Robert Lighthizer and Canada’s Foreign Affairs Minister Chrystia Freeland said late Sunday after six weeks of intense talks and more than a year of fraught, broader negotiations. In the end, Canada and the United States overcame their differences after both sides conceded some ground to reach a deal covering a region of 500 million inhabitants and which conducts about $1 trillion in trade a year. “It’s a good day for Canada,” Canadian Prime Minister Justin Trudeau said Sunday night. Mexican Foreign Minister Luis Videgaray tweeted that the deal was good for his country “and for North America”. The political stakes were high. Trump, who pursues an “America First” policy on trade, needs to look strong heading into the November midterm elections where his Republican Party is fighting to keep control of Congress. Trudeau, for his part, did not want to be seen as caving in before next year’s general election in Canada. But on the other hand, it risked being frozen out of a US-Mexican deal reached in August. Early Monday a copy of the deal’s 34 chapters was posted on the US Trade Representative’s website. The pact can now be signed before Mexico’s President Enrique Pena Nieto leaves office December 1, the date that caused the last-minute flurry of activity. US law requires the White House to submit the text to Congress 60 days before signing — and officials barely made it by the midnight deadline.In order to reach the deal Canada agreed to open its dairy market further to US producers, and — in return — Washington left unchanged the dispute settlement provisions. Under Canada’s supply-managed dairy system, Ottawa effectively sets production quotas, which raises prices to consumers but provides farmers with a stable income. Tariffs of up to 275 percent have kept most foreign milk out of the Canadian market. Canada had opposed US demands to weaken or eliminate NAFTA’S dispute resolution mechanism, whose arbitration panels Ottawa used to resolve trade conflicts, particularly concerning its important lumber industry. In recent days warnings were mounting that time was running out to clinch a new deal, but a senior US administration official said the final rewrite is a “fantastic agreement”.Alongside changes to the dairy market in Canada, officials said it includes stronger protections for workers, tough new environmental rules, and updates the trade relationship to cover the digital economy and provides “groundbreaking” intellectual property protections. The AFL-CIO, a Washington-based federation representing millions of unionized employees, said it was too early to “make a final judgment” on the new deal’s impact on working people. One of the most important sectors concerns the auto sector, which NAFTA revolutionized. The US had sought increased American content for duty-free autos. The new text provides rules to encourage North American supply of components. While the pact should protect Mexico and Canada from Trump’s threatened 25 percent tariffs on cars, still pending are the duties on steel and aluminum, which officials said was on a “separate track”, handled by the Commerce Department. Under Sunday’s deal, the trade pact will remain in force for 16 years but will be reviewed every six years. US negotiators had been demanding reauthorization every five years.