More than 45 countries, among the most vulnerable to climate change, have said they will switch entirely to renewable energy as soon as possible.

The announcement was made at climate talks in Marrakech, Morocco, where negotiators have been hammering out the details of an agreement made last year to keep global temperature increases "well below" 2 degrees and to "pursue efforts" to stay below 1.5 degrees.

Many of the countries making the pledge to withdraw from fossil fuels belong to the Climate Vulnerable Forum, a group encompassing countries committed to ensuring the 1.5 degrees goal is met.

Countries slated to adopt the document would agree to "strive to meet 100 per cent domestic renewable energy production as rapidly as possible".