Image source, ReutersImage caption, Coal produced around 37% of the world's electricity in 2019
Major coal users including Poland, Vietnam and Chile are committing to shift away from the fossil fuel, in pledges made at the COP26 climate summit, the UK government says.
Coal is the single biggest contributor to climate change.
The UK said 190 nations and organisations had vowed to quit coal.
But some of the world's biggest coal-dependent countries, including Australia, India, China and the US, did not sign up to the pledge.
Signatories to the agreement have committed to ending all investment in new coal power generation domestically and internationally.
They have also agreed to phase out coal power in the 2030s for major economies, and the 2040s for poorer nations, the UK said.
"The end of coal is in sight," UK business and energy secretary Kwasi Kwarteng said.
"The world is moving in the right direction, standing ready to seal coal's fate and embrace the environmental and economic benefits of building a future that is powered by clean energy."
More than 40 countries have signed up to the statement. Poland, Vietnam and Chile were among 18 countries who agreed to phase out and not build or invest in new coal power for the first time, the UK said.
But UK Shadow business secretary Ed Miliband said there were "glaring gaps" from the likes of China and other large emitters, who have not committed to stop increasing coal domestically. He also noted that there was nothing on the phasing out of oil and gas.
Mr Miliband said the UK government "has let others off the hook".
What is COP26?
Skip image gallery
Tap or click to go through the gallery
End of image gallery
Although progress has been made in reducing coal use globally, it still produced around 37% of the world's electricity in 2019.
Countries like South Africa, Poland and India will need major investments to make their energy sectors cleaner.
Juan Pablo Osornio, head of Greenpeace's delegation at COP26, said: "Overall this statement still falls well short of the ambition needed on fossil fuels in this critical decade."
He added: "The small print seemingly gives countries enormous leeway to pick their own phase-out date, despite the shiny headline."
- Why the COP26 climate summit is important
- Simple guide to climate change
- Four ways to reduce your emissions
- What are top polluters doing to cut emissions?
- Life where it's too hot to work, too hot to sleep