Canada and the United States reached a deal last night for Canada to stay in a free trade pact with the U.S. and Mexico.

In a joint statement, U.S. Trade Representative Robert Lighthizer and Canadian Foreign Affairs Minister Chrystia Freeland said the agreement “will strengthen the middle class, and create good, well-paying jobs and new opportunities for the nearly half billion people who call North America home.”

The new deal, will be called the United States-Mexico-Canada Agreement, or USMCA. It replaces the 24-year-old North American Free Trade Agreement.

The agreement reached yesterday gives U.S. farmers greater access to the Canadian dairy market.

But it keeps a NAFTA dispute-resolution process that the U.S. wanted to jettison and offers Canada protection if US President DonaldTrump goes ahead with plans to impose tariffs on cars, trucks and auto parts imported into the United States.