The world’s richest nations have agreed to end their financial support for coal development overseas, in a major step towards phasing out the dirtiest fossil fuel.

After nearly two days of wrangling at a meeting of the G7 environment and energy ministers, hosted virtually by the UK on Thursday and Friday, all reaffirmed their commitment to limiting global heating to 1.5C, and committed to phasing out coal and fully decarbonising their energy sectors in the 2030s.

Japan, one of the world’s biggest sources of finance for coal power, along with China, held out on agreeing to stop helping to build until the final stages of the two-day virtual meeting. Japan’s government raised concerns that if it halted the financing, China would step in and build coal-fired power plants overseas that were less efficient than Japanese designs.

The other G7 members – the UK, the US, France, Italy, Germany and Canada – were all united in calling for an end to such financing. The rich countries that make up the G7, along with other major non-G7 economies such as China and South Korea, have played a major role in the past in financing fossil fuel development in poorer countries. Japan, China and South Korea in particular have offered to help build coal-fired power plants in cash-strapped developing countries.

However, the International Energy Agency said earlier this week that all new developments of fossil fuels must end this year to give the world a good chance of keeping within the 1.5C limit. A recent increase in the use of coal, after last year’s lockdowns around the world, is largely responsible for what is forecast by the global energy watchdog to be the second biggest rise in emissions on record this year.

Barbara Pompili, France’s environment minister, said: “I am delighted that an agreement could be found regarding a key aspect of our G7 communique: the absolute end of new direct government support for international coal power generation. It gives a very strong signal to the world that coal is an energy of the past and has no place in our future energy mix. It sets the stage for a radical transition towards clean energy.

“That was a difficult decision for Japan in particular, and I am very pleased that Japan was able to take this decisive step.”

South Korea, another major source of finance for coal-fired power generation overseas, has already agreed to end the practice. That leaves China as the biggest source of such finance in developing countries.

China will now be keenly watched ahead of Cop26, the vital UN climate talks to be hosted by the UK in Glasgow this November. The world’s biggest emitter has yet to produce a national plan for curbing greenhouse gas emissions by 2030, called a nationally determined contribution (NDC) and an essential part of any deal at Glasgow.

Amina Mohammed, deputy secretary-general of the UN, told the meeting: “We are running out of time to bend the emissions curve and cut emissions by 45% globally by 2030 and that’s from 2010 levels. This means all main emitters must deliver enhanced NDCs this year with concrete and credible targets that we can follow through to 2030. Important investments in the targets we set for 2030 will determine the outcome of credibility of the 2050 targets. And it means no new coal starting now, phasing out coal in OECD countries by 2030, and in the rest of the world by 2040.”

The UK, which holds the rotating presidency of the G7 this year, as well as hosting the Cop26 summit, has also called on all countries to phase out coal for power generation. However, its efforts have been overshadowed by a row over a possible new coalmine in Cumbria, now the subject of a public inquiry.

The G7 communique contains a caveat, the Guardian understands, at the behest of the Japanese government, that would allow financing for coal in “limited circumstances at the discretion of each country”. It is understood this will only be used in exceptional circumstances.

The draft text reads: “We commit to promoting the increased international flow of public and private capital toward Paris Agreement-aligned investments and away from high-carbon power generation to support the clean energy transition in developing countries. In this context, we will phase out new direct government support for carbon-intensive international fossil fuel energy, except in limited circumstances at the discretion of each country, in a manner that is consistent with an ambitious, clearly defined pathway towards climate neutrality in order to keep 1.5C within reach, in line with the long-term objectives of the Paris Agreement and best available science.

“Consistent with this overall approach and recognising that continued global investment in unabated coal generation is incompatible with keeping 1.5C within reach, we stress that international investments in unabated coal must stop now and commit to take concrete steps towards an absolute end to new direct government support for unabated international thermal coal power generation by the end of 2021, including through Official Development Assistance, export finance, investment, and financial and trade promotion support.”