The consensus is the first step in turning the commission's proposal into an EU law as the bloc struggles with the economic consequences of the war in Ukraine.
It comes as part of a long-term response to soaring energy prices in the European Union as a consequence of Russia's war on Ukraine.
Where is the money coming from?
Ministers agreed that money to reduce EU dependency on Russian fossil fuels should be raised by taking about €15 billion from the EU's innovation fund.
About €5 billion would also come from selling carbon dioxide emission licenses to industries sooner than planned from the EU carbon market's "market stability reserve."
The money would be used to diversify energy supplies and replace fossil fuels. The delegates agreed to allocate funds in a way that recognizes some EU countries are more dependent on Russian oil, gas, and coal than others.
The €20 billion is part of a plan of the European Commission to raise up to €300 billion in loans and grants to boost investments into renewable energy.
A large part of the amount — up to €225 billion — is to come from unclaimed money from the European Union's COVID-19 recovery fund, according to the proposal.
The talks took place as Germany comes in for criticism over a costly package to protect homes and firms from soaring energy costs.
Praise for progress made
"Today we achieved a major step forward in strengthening Europe's autonomy from Russia's fossil fuels," said Czech Finance Minister Zbynek Stanjura, who chaired the talks.
"It will help improve EU energy security and tackle high energy prices by investing quickly where it matters most," EU Economy Commissioner Valdis Dombrovskis wrote on Twitter.
French Finance Minister Bruno Le Maire said the agreement would help member states fight inflation and invest in cutting reliance on fossil fuels.
The European Parliament next has to agree on a position before member states and legislators can begin negotiating the legislation together.
The ministers on Tuesday were also discussing the wider economic consequences of the war in Ukraine amid record inflation and financial support for Kyiv.
rc/rt (Reuters, dpa)