A pan-Canadian agreement on climate change narrowly avoided going off the rails Friday night as British Columbia fought for concessions on how it will implement a carbon price.

Immediately following the end of talks between the premiers and Prime Minister Justin Trudeau in Ottawa, B.C. Premier Christy Clark appeared before reporters to say her province wouldn’t be coming on board.

Federal Environment Minister Catherine McKenna said the same in a scrum shortly afterward, and added Saskatchewan and Manitoba would also not be signing onto what’s formally called the Pan-Canadian Framework on Clean Growth and Climate Change.

That changed within minutes as news of a change in B.C.’s position rippled through a government conference hall where the day-long talks took place.

In the day’s final news conference, Clark said “there was an issue of fundamental fairness that we needed to see resolved in the agreement.”

B.C. already implements a $30 per tonne tax on carbon. Under today’s agreement, provinces and territories are supposed to start implementing a $10 a tonne price through either a direct tax or a cap-and-trade system in 2018. That price would rise by $10 per tonne a year until it reaches $50 per tonne in 2022.

Under last-minute changes to the deal, B.C. preserves the right to decide whether jurisdictions using cap-and-trade systems are doing so in a way that is equivalent to B.C.’s price when the national price matches its own in 2020 at $30 per tonne.

The province now also has the power to decide how it will begin to price carbon after 2020 when its price begins moving in concert with the one set nationally by Ottawa.

“I should say thank you to the Canadian government — the prime minister — for allowing this level of flexibility,” said Clark after the changes were made. “We wouldn’t have been able to sign on without those changes.”

Trudeau praised the premiers for working on an agreement that he described as “long overdue.”

“I want to thank all the premiers for being here today — for coming into this meeting with some strongly-held views — but also with a willingness to work hard on behalf of all Canadians,” said Trudeau.

The agreement doesn’t only focus on carbon pricing, but includes provisions on everything from green infrastructure funding to helping provinces link up their electrical grids, he said.

Saskatchewan’s opposition to the deal was a foregone conclusion, but the evening’s final announcement — a major achievement for Trudeau after years of disjointed carbon policies across the country — was a chance to see the divisions between Premier Brad Wall and his colleagues laid bare.

The province’s high-emitting industries — mining, oil and gas and agriculture — would suffer at the hands of a carbon price, even it were to only start in 2018, said Wall.

Making it revenue neutral also doesn’t change the fact that lower-cost jurisdictions — the U.S. in the case of shale oil, Russia in the case of potash — will become more attractive to operators, he said.

“A carbon tax is going to disproportionately affect those sectors and all of those, save agriculture, are under stress right now,” said Wall. “There’s about 3,000 jobs that have been lost in the energy sector alone in our province”

“The timing is still wrong today and I just didn’t hear what I might have needed to hear about the pricing mechanism itself.”

Manitoba’s Progressive Conservative government, which only came to power in April, is still in the midst of drawing up a climate change plan, said Premier Brian Pallister.

The province will launch a plan with targets that are commensurate with the pan-Canadian framework on climate change, he said.

Pallister also mentioned healthcare costs when asked why he didn’t sign on to the climate deal, without saying directly that was a reason he decided not to sign on.

The premiers met without Trudeau earlier in the day Friday to discuss their strategy. Ontario Premier Kathleen Wynne emerged from that meeting stating healthcare was something the premiers wanted to discuss.

“I will tell you that the preoccupation of all the premiers this morning is with health care,” said Wynne.

The premiers are looking for Ottawa to shoulder a higher percentage of health care costs.

Trudeau has invited the provincial and territorial ministers of health and finances to come to Ottawa next week to discuss major talks on healthcare, the prime minister said.

Indigenous leadership – the Assembly of First Nations, the Metis National Council and the Inuit Tapiriit Kanatami – also participated in the day’s final news conference.

The AFN and Metis National Council praised the federal government for inviting them to the talks but also criticized the fact they were not invited to draft the more consequential parts of the climate agreement.

“It’s been good,” said Metis National Council president Clement Chartier. “We’d certainly like to see a greater, expanded role for the Metis nation.”

Indigenous and Northern Affairs Minister Carolyn Bennett said that indigenous leaders were involved in writing part of the agreement in a morning meeting and that they would have some kind of role in the future.

Today’s climate agreement is intended to confirm Canada’s greenhouse gas (GHG) emission targets for 2030. The federal government has pledged a 30 per cent reduction from 2005 levels by 2030. That would amount to 524 megatonnes of carbon dioxide equivalent in 2030.

The country is currently on track to emit between 765 and 875 megatonnes of carbon dioxide equivalent in 2030, according to Environment Canada.

The pan-Canadian framework’s provisions on carbon pricing will apply in “one hundred per cent” of Canada once it begins in 2018, said Trudeau.