The world’s biggest economies must stop funding all overseas fossil fuel development from the end of this year, which risks stifling some of the investment in “carbon bombs” that jeopardize efforts to achieve global climate goals.

The deal could shift around $33bn (£26bn) a year from fossil fuels to clean energy sources, analysts estimate.

Energy and environment ministers from all G7 nations agreed at a meeting in Berlin on Friday to end taxpayer funding for overseas oil, gas and coal projects. Member countries are Japan – which stood firm against such a pledge ahead of last year’s Cop26 climate summit – the UK, the US, Canada, Italy, France and this year’s host country, Germany.

Alok Sharma, the UK’s Cop26 president, said the pledge showed, against the backdrop of the war in Ukraine and high fossil fuel prices, that the transition to clean energy was more important than ever. “We are united in the idea that climate and environmental security are absolutely synonymous with energy and national security and I cannot overstate this. Solving the global energy crisis and the chronic climate crisis requires the same solution: it is about reduce our dependence on fossil fuels as part of a controlled transition.

Laurie van der Burg, co-campaign manager of green group Oil Change International, said: “The G7 is committed to ending public funding of fossil fuels and moving it to clean energy. [energy] is a massive victory. This is a timely reconfirmation [amid the Ukraine war] that the most viable path to energy security is to prioritize public finance for clean energy. These promises now urgently need to be turned into action.

Sign up for First Edition, our free daily newsletter – every weekday morning at 7am BST

Projects already underway may escape the new commitment. This means that many of the “carbon bombs” – new oil and gas projects around the world that are in development and, if realized, will eliminate any chance of limiting global warming to 1.5°C – that the Guardian found in a recent survey might still be eligible for such public funding.

The Guardian has found almost 200 carbon bombs, of which around 60% are already underway and have started pumping. Most of their financing is likely to come from private or public sources outside the G7 countries, but foreign public sector financing can be an important catalyst for new oil and gas projects, as it reassures private and developing country investors. .

The G7 communiqué also failed to cover domestic public sector funding for fossil fuels, with some of the member countries continuing to subsidize fossil fuels and provide significant tax breaks.

On Thursday, the UK announced a windfall tax on fossil fuel companies, with a loophole allowing them to escape 90% of the tax if they invest in new oil and gas production in the North Sea, despite UK carbon budgets. Critics said it would not help alleviate short-term supply problems, as new exploration sites can take decades to come into production, and it amounted to a de facto subsidy worth billions of pounds for new oil and gas.

The G7 pledged last year to end overseas coal funding, and some members agreed to end all overseas fossil fuel funding, but this is the first time the seven countries reach a global agreement covering all fossil fuels.