France's parliament has approved a law banning all exploration and production of oil and natural gas by 2040, both within the country and its overseas territories.

In what is a world first, under the new law, all existing drilling permits will not be renewed and no new exploration licenses will be granted.

The move is largely symbolic as France imports most of its oil and gas, only extracting the equivalent of about 815,000 tonnes of oil per year, an amount produced in a few hours by Saudi Arabia.

President Macron said he said he is 'very proud' France has become the first country in the world to ban oil and gas exploration

The move is part of France's attempt to move away from the consumption of fossil fuels

President Emmanuel Macron has said he wants France to take the lead as a major world economy switching away from fossil fuels - and the nuclear industry - into renewable sources.

His government plans to stop the sale of diesel and petrol engine cars by 2040 as well.

In a tweet he said: 'Very proud that France has become the first country in the world today to ban any new oil exploration licenses with immediate effect and all oil extraction by 2040.'

Socialist lawmaker Delphine Batho said Tuesday she hoped the ban would be 'contagious', inspiring bigger producers to follow suit.

Environment Minister Nicolas Hulot says the law shows 'current generations can take care of future generations.'

Above all the ban will affect companies prospecting for oil in the French territory of Guyana in South America, while also banning the extraction of shale gas by any means - its extraction by fracking was banned in 2011.