By covering all fossil fuels, including oil and gas, the deal goes further than a pledge made by G20 countries this year to halt overseas financing for just coal.
The United States, Canada and 18 other countries have committed at the COP26 climate summit to stop public financing for fossil fuel projects abroad by the end of next year, and steer their spending into clean energy instead.
"We will end new direct public support for the international unabated fossil fuel energy sector by the end of 2022," they said in a declaration on Thursday.
That would cover coal, oil and gas projects that are "unabated" – meaning that they burn fossil fuels without using technology to capture the resulting CO2 emissions.
The deal allowed for exemptions in unspecified "limited" circumstances, which it said must be consistent with the Paris Agreement's target to cap global warming at 1.5C.
It goes further than a pledge made by G20 countries this year to halt overseas financing for just coal.
The 20 countries that signed the pledge include Denmark, Italy, Finland, Costa Rica, Ethiopia, Gambia, New Zealand and the Marshall Islands, plus five development institutions including the European Investment Bank and the East African Development Bank.
But it did not include major Asian countries responsible for the bulk of such financing abroad.
Campaigners called the commitment a "historic" step in turning off the funding taps for fossil fuel projects.
Rising pressure to limit emissions
Governments and financial institutions are facing increased pressure to stop funding coal, oil and gas projects responsible for producing the greenhouse gas emissions that are driving climate change, both at home and abroad.
Denmark said on Wednesday that it would halt international financing for investments, projects or activities that promote fossil fuels by the end of this year, with exemptions for some gas projects that meet "strict conditions" until 2025.
The COP26 deal also aligns with policies in countries including Britain, which ended direct government support for new fossil fuel projects overseas this year. The European Investment Bank has also committed to end oil and gas project funding this year.
The agreement, while not binding, would attempt to build consensus between wealthier and poorer nations around overseas financial support to stop backing fossil fuel projects and instead support clean energy both to curb emissions and to avoid building stranded assets.