The G7 has called for a transformation of electricity generation towards clean sources by 2050.
They said fossil fuel emissions should not be allowed in any sector of the economy by the end of the century.
Their targets are not binding - but they send a clear message to investors that in the long term economies will have to be powered by non-polluting energy.
The world's leaders have effectively signalled the end of the fossil fuel era that has driven economies since the Industrial Revolution.
This is a seismic shift - and an acknowledgement from the leaders, prompted by Angela Merkel, of the scale of the threat from climate change.
The G7's mid-century target is for emissions to be cut 40-70% globally compared with 2010.
The G7 also accepted that rich nations would need to help poorer countries - especially in Africa - develop using clean technology, and adapt to inevitable changes to climate in the future.
They have promised to address risks from weather disasters that may become more serious as the climate heats and they say they will help with insurance and protection for the poorest.
But they will be pushed by developing nations to show they are making good their previous promise of £100bn in climate finance by 2020.
The leaders also promised to strengthen cooperation over energy efficiency and work together with other interested countries to co-ordinate clean energy research, development and demonstration - as urged by the UK's climate ambassador David King.
The resolutions will feed into the meeting of world leaders to seal a global deal on climate later this year in Paris. A positive outcome there is now more likely.
But huge questions remain. Some scientists and environmentalists accused the G7 of reckless complacency by suggesting that we can afford to burn fossil fuels at all past 2050.
On the other hand there are worries from some developing countries about the suggestion that coal should be phased out. It is not clear how poor nations are to be persuaded to ignore the cheapest fuel available in their attempts to develop.
The cost of solar energy is plummeting, and is now competitive with coal in some parts of the world, but it has not yet shown that it can power industries on a large scale.
Gas fuel firms say carbon capture and storage technology, which would take most of the emissions from a fossil fuel power station and bury them underground, will allow economies to continue to benefit from a consistent power source. But the technology is still in its infancy.
Follow Roger Harrabin on Twitter @rharrabin