Analysis - With the revised TPP now going ahead, RNZ's Gyles Beckford breaks down what got it over the line, and what's in it for New Zealand.
The-now 11 nation trade had looked like it was going to go ahead before US President Donald Trump announced he was against it, and then withdrew in one of his first acts as President in January last year.
The remaining nations held out hope, and met in November to hammer out a new agreement under the catchy moniker the Comprehensive and Progressive Agreement for the Trans-Pacific Partnership - or CPTPP.
It looked like a deal had been struck until a Canadian no show at a leaders meeting threw its future in doubt, but intense negotiations managed to conclude most issues.
Those that remain appeared to have been resolved.
Agreement to Canada's demands to protect French language cultural industries, the suspension of some provisions on intellectual property, and a side-deal with Japan on automotive components seems to have removed the last substantial barriers to the deal.
Vietnamese concerns about being punished for not meeting labour standards have also been answered.
Canadian Prime Minister Justin Trudeau called the agreement the "right deal", and Japan's Economy Minister, Toshimitsu Motegi, said the CPTPP would be an "engine to overcome protectionism".
News of the Pacific-rim trade deal has come on the same day that President Trump imposed steep duties on imported solar panels and washing machines, which he said were hurting American producers.
China and South Korea, neither of which is in the CPTPP, have said they are looking at their options and may retaliate.
The CPTPP covers nearly 500 million people and makes up 14 percent of global economic activity, or about $US10 trillion.
Benefits for New Zealand
The gains for New Zealand seem to be largely from improved market access for wine, beef and kiwifruit - particularly into the Japanese market.
The government's ban on foreign ownership of residential property has been accommodated, but hopes of cracking open Canada's heavily protected dairy sector have made little progress.
New Zealand will also have four new bilateral trade agreements with Japan, Mexico, Canada and Peru.
The original 12-member TPP deal was being promoted by New Zealand officials and politicians as a $4 billion boost for the economy over a long period.
In November, Prime Minister Jacinda Ardern said it would have real benefits for the economy.
The CPTPP has been a more than a decade in gestation, starting as a low-key agreement between New Zealand, Chile, Brunei, and Singapore in 2005.
But momentum for a larger Asia-Pacific-wide trade deal was given a boost when the US joined the talks in 2008.
The Obama administration was a strong driver of the deal, although Japan's late admission to the talks complicated reaching agreement, and then the Trump administration's withdrawal was thought to have delivered the coup de grace.
The prize for most of the CPTPP signatories was going to be a vaunted and lucrative trade deal with the United States. That may yet happen if a post-Trump administration bothers to knock on the door which has been left open.
But in the short term the countries who have signed on will have to make do with a more modest trade deal offering much more modest returns.