President Trump on Monday praised Canada for joining the U.S. and Mexico in a new trilateral trade agreement that will replace NAFTA.

"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 tweeted.

"The new name will be The United States Mexico Canada Agreement, or USMCA," he said over two tweets. "It is a great deal for all three countries, solves the many deficiencies and mistakes in NAFTA, greatly opens markets to our Farmers and Manufacturers, reduces Trade Barriers to the U.S. and will bring all three Great Nations closer together in competition with the rest of the world."

Trump said the new U.S.-Mexico-Canada Agreement, or USMCA, is an "historic transaction!"

The U.S. had a midnight deadline to submit a proposed deal to Congress by midnight, and Canada's agreement allowed it to join the deal and maintain some semblance of the three-way NAFTA deal that's been in place for more than two decades.

Trump had threatened to impose tariffs on Canada's auto exports if a deal wasn't there.

The final agreement will require cars exported from Canada and Mexico to have a higher percentage of North American content, and will give the U.S. increased access to Canada's dairy market. Those are two big wins for Trump, who has said NAFTA was negotiated in a way that made it harder to keep production jobs in the U.S.

The agreement will keep in place a dispute settlement system that Canada wanted to keep in place, which allows companies to pursue unfair trade cases directly against an opposing government.