Canada has agreed to join the US and Mexico in a trade deal that will replace the North American Free Trade Agreement (NAFTA).

The trade deal has taken weeks to conclude, following an earlier bilateral trade deal settlement between the US and Mexico.

The trade deal includes changes to rules of origin on autos, which dictate that, to avoid tariffs, a certain percentage of an automobile must be built from parts that originated from countries within the three countries of North America.

Under the new rules, cars must be built with at least 75% of parts made in North America, up from 62.5% under NAFTA. Also, some 40-45% percent of an auto will have to be made by workers earning at least USD16 an hour. The changed rules of origin stipulations are aimed at preventing vehicle manufacturers making too many cars in low-cost Mexico for shipment to the US.

The new trade deal also includes standards designed to protect intellectual property and trade secrets.

The agreement will run for 16 years but will be reviewed after six years and could then be extended for another 16.

 "Today, Canada and the United States reached an agreement, alongside Mexico, on a new, modernized trade agreement for the 21st century: the United States-Mexico-Canada Agreement (USMCA)," said US Trade Representative Robert Lighthizer and Canadian Foreign Affairs Minister Chrystia Freeland in a joint statement. "USMCA will give our workers, farmers, ranchers and businesses a high-standard trade agreement that will result in freer markets, fairer trade and robust economic growth in our region."

The US had imposed a deadline of midnight Sunday with Canada to reach a new tri-lateral deal.

The deal also provides the US with greater access to Canada's dairy market.

The deal is expected to be signed by all three countries by the end of November.

US President Donald Trump has praised the new trade deal, which will be the United States Mexico Canada Agreement, or USMCA.

A dispute resolution process that the US had wanted to scrap but Canada wanted to keep will be revised.