ATLANTA — Twelve nations, including Canada, have reached a tentative deal on a massive Pacific Rim trading bloc billed as the largest-ever deal of its kind, with implications for hundreds of millions of people, hundreds of products and industries, and for long-term relationships between countries on four continents.

After five days of marathon, around-the-clock negotiations, a deal was announced Monday to create the Trans-Pacific Partnership — which would start by covering 40 per cent of the world's economy, with participants predicting it would become the building block for future trade deals.

"Today is a historic day; it is a great day for Canada, it is a great day for Canadians," Prime Minister Stephen Harper beamed during a news conference Monday in Ottawa.

"With this agreement, the largest economic partnership in the history of the world, Canadian exporters will gain nearly tariff-free access to almost 800 million customers in the Asia-Pacific region... including — crucially for us — Japan.''

First, however, the deal requires political approval.

To take effect, it must be ratified by the parliaments and lawmaking authorities of all 12 member countries. Canada will be the first political testing-ground — the agreement lands smack in the midst of a federal election campaign to decide who will control the Parliament that determines whether it lives or dies.

The drama reached a high point overnight Monday, as a series of delays culminated in an agreement around 5 a.m. on a persistent irritant involving dairy and the future of Canada's tightly controlled sector.

The Canadian government appears to have assured the long-term entrenchment of the supply-managed sector, which is detested by free-market economists but backed by every major political party, provincial governments, and the domestic dairy lobby.

Canada agreed to 3.25 per cent more foreign imports, a minuscule change compared to what some countries asked for. That means a bit more international products like butter on grocery shelves now 90-per-cent dominated by domestic content. For their loss, Canadian farmers will receive billions in government support under a series of programs over at least 10 years.

The reaction from the auto industry has been more negative.

The government certainly spent less time Monday discussing the results for that sector than it did for dairy. In a briefing, the federal government offered bits of info on autos compared to a six-page press release, an 11-page PowerPoint presentation and two federal ministers talking about dairy.

The Canadian auto-workers' union called it a disastrous deal that could cost 20,000 manufacturing jobs. Even some of their bosses expressed concern, through industry groups.

Harper has promised new measures soon to attract auto investment and protect auto-assembly operations in Canada and CTV News reported late Monday that Harper will announce more than $1 billion to help the industry during a visit Tuesday to Whitby, Ont.

A source told the network Harper will announce a 10-year plan to provide loans and grants to lure global auto-parts manufacturers to Canada and various incentives for Canadian manufacturers to buy new equipment and modernize plants.

There's a major discrepancy between Canada and the U.S. on tariff-elimination for cheaper Asian parts — with a five-times-faster phase-out north of the border, five years compared with the U.S.'s 25 years. In addition, both countries will see a 17.5-per-cent drop in the amount of regional content required in cars to avoid a tariff, compared with NAFTA.

The government played down the significance of the difference on tariffs, saying the U.S. one is practically non-existent already — at 2.5 per cent, compared to Canada's 6.1 per cent tariff.

The Canadian envoy to the negotiations didn't make any promises specific to workers in any individual sector. But he appeared to insist there would be no net negative impact on Canadian employment as a whole.

"We certainly don't anticipate that there will be job losses," said International Trade Minister Ed Fast, who suspended his re-election campaign in B.C. for nearly a week to attend the Atlanta talks.

''Obviously there will be some industries that will adapt.''

His colourful New Zealand counterpart had used a memorable metaphor this week to describe the late-stage negotiations. In an apparent reference to the meagre Canadian offering on dairy, Tim Groser said that completing the deal would require compromise — or, in his words, for every country to take a deep gulp and swallow a few ''dead rats.''

But he touted the long-term benefits Monday. Groser predicted the agreement would have far-reaching geopolitical consequences.

''Long after the details of this negotiation on things like tonnes of butter have been regarded as a footnote in history, the bigger picture of what we've achieved here remains,'' Groser said.

''It is inconceivable that the TPP bus will stop in Atlanta. The TPP bus will move on.''

Several countries including Thailand and Colombia have already mused about joining TPP, which involves North America, Chile, Peru, Japan, Brunei, Singapore, Vietnam, Malaysia, New Zealand and Australia.

The proposed agreement reduces or eliminates barriers in a wide range of sectors and could lead to more Canadian exports of pork, beef, canola, forestry, minerals, high-tech machinery and a variety of other products.

As one example among hundreds, the beef industry predicts exports to Japan will triple. The 39 per cent current tariff in Japan will become nine per cent over the next few years, and barriers will completely disappear in other areas.

But voters can't yet see the fine print.

The actual text of the deal is undergoing a legal review, and it's not clear when it will be available. The government offered no guarantees at a news conference. It simply expressed hope the 12 countries might manage to make it available in the next few days — before voters pick a government Oct. 19.

The reaction was quick and diverse.

Some members of Canada's auto sector have promoted the pact, but there was consternation Monday from labour and industry groups. A coalition of Canadian unions called the entire pact a serious blunder — expressing skepticism about promised provisions that would guarantee collective-bargaining and prevent child labour.

Even in the dairy sector, reaction was split.

Some farmers practically celebrated.

The supply-management system appears assured for at least another generation, said the head of Dairy Farmers of Canada. It's now survived two big international trade negotiations, including the one with Europe. And with no other big deals on the horizon, it appears the system of quotas and import controls is here to stay.

''The TPP is good for Canada,'' said Wally Smith. '''Farmers today in Canada are far more confident in their future... as opposed to always having a cloud over their head.''

But there was more opposition in Quebec. A provincial cabinet minister grumbled about the deal, as did the Bloc Quebecois, and did the province's farming lobby. One small-scale farm group, the Union Paysanne, declared: "Canadian agriculture just got creamed."

Alexander Panetta, The Canadian Press

Story updated at 08:47 EDT on Oct. 6.

Keep reading