Nations at the UN climate summit have for the first time taken explicit aim at the use of fossil fuels.

The talks in Dubai came close to collapse but in a dramatic turn-around, nations agreed to “transition away” from coal, oil and gas.

But small islands hit hard by climate change protested, saying the deal was rushed through without them.

And it departed from earlier stronger language to “phase out fossil fuels”.

Many nations including the US, UK and European Union had pushed for a phase out from the opening of the talks.

Close to 200 nations were in the United Arab Emirates for almost two weeks to try to make progress on tackling climate change after months of record-breaking extreme weather.

Expectations had been low that oil-rich United Arab Emirates could deliver a deal that took aim at the fossil fuel industry. The COP28 president Sultan al-Jaber’s dual role as CEO of Abu Dhabi oil giant Adnoc attracted further criticism.

Onlookers’ fears of a conflict of interest seemed confirmed when leaked documents suggested Mr Jaber had planned to use the presidency to strike business deals.

But on Wednesday Mr Jaber delivered a jubilant speech, saying the conference “should be proud of our historic achievement”.

The deal today will likely be seen as a victory for his leadership.

The gavelling of the deal itself took many delegates by surprise but was met with cheers and a standing ovation in the plenary room.

However, a representative for the Alliance of Small Island States (Aosis) – representing nations on the frontlines of climate change – took the microphone as soon as comments were open to nations.

“It seems that you just gavelled the decisions when the small island states weren’t in the room,” she said.

And she said Aosis are concerned that the key language about transitioning away from fossil fuels “potentially takes us backward rather than forward”.

The 21-page deal Mr Jaber presided over says countries will “contribute… to transitioning away from fossil fuels in energy systems in a just, orderly and equitable manner”.

It also recognises that global emissions of warming gases will likely peak before 2025, but could be later for developing nations.

Pushback from oil-producing nations including Saudi Arabia appears to have been successful in softening the commitments.

Poorer nations that are reliant on fossil fuel exports, including Iraq, also opposed the stronger language because they said it did not fairly reflect their limited role in causing climate change.

And many developing countries said other agreements at COP28 did not secure enough finance to transition their countries onto greener energy or make up for the loss of income from selling fossil fuels.

But all nations at the talks appeared to accept the compromise of the deal.

US Climate Envoy John Kerry said that in the context of conflict in Ukraine and in Israel and Gaza, the deal was “cause for optimism”.

He admitted the text did not have everything the US had pushed for, but he said it was a step forwards and represented what nations could agree to.

Wopke Hoekstra, the European Union’s climate commissioner, saluted the deal as an historic achievement after 30 years of no agreement on the fossil fuel question.

And the UK climate minister Graham Stuart told the plenary it was “the beginning of the end of the fossil fuel era” but admitted “there are elements here we do not like”.

Away from politicians’ speeches, activists and scientists called the deal weak, saying it does little to fix the growing problem of emissions released into the atmosphere, causing global warming.

Countries have just six years to reach a target of cutting greenhouse gas emissions by 45% but are far off track.

Uganda youth activists Vanessa Nakate said the decision is “nowhere near enough” and called the meeting “a fossil fuel COP out”.

Tuvalu negotiator Mervina Paeuli, 25, said she was left with “mixed feelings”, and worries the deal does little for her Pacific island home.

“If the overall goal was to push action for the 1.5C target, then it’s not a good day for me,” she said, referring to the globally-agreed goal of limiting temperature rise to 1.5C.

And despite the chair of the UN Intergovernmental Panel on Climate Change, Prof Jim Skea, saying that Mr Jaber is “attentive to the science” during the COP talks, many scientists are sceptical of the deal.

“No doubt there will be lots of cheering and back-slapping… but the physics will not care. As the new agreement locks in high levels of emissions for years to come, so the temperature will continue to rise,” said Prof Kevin Anderson from University of Manchester.

The United Nations Secretary-General António Guterres also gave his judgement. He said many governments wanted a clear reference to phase out fossil fuels but “it was watered down”.

“Whether you like it or not, fossil fuel phase out is inevitable. Let’s hope it doesn’t come too late,” he said.

The host for the UN climate talks, in 2024, was also confirmed as gas-rich Azerbaijan in the Caucuses.