France plans to pass legislation by the end of 2017 to phase out all oil and gas exploration and production on its mainland and overseas territories by 2040, becoming the first country to do so, according to a draft bill presented on Sept. 6.

President Emmanuel Macron wants to make France carbon neutral by 2050 and plans to curb greenhouse gas emissions by leaving fossil fuels, blamed for contributing to global warming, in the ground.

Under the draft bill presented to cabinet on Sept. 6, France will no longer issue exploration permits and the extension of current concessions will be gradually limited until they are phased out by 2040—the same year when France plans to end the sale of gasoline and diesel vehicles.

The decision is, however, largely symbolic because France only produces about 6 million barrels of hydrocarbons a year, representing about 1% of its consumption.

France will continue to import and refine oil for its needs.

"The law will halt the exploitation of hydrocarbons in our territory; existing concessions cannot be renewed beyond 2040," the draft bill states.

No shale gas permit has ever been issued in France and it will be impossible to do so after the law is passed.

The law could impact companies such as French oil major Total SA (NYSE: TOT), which although it has discontinued oil exploration in mainland France, still has permits to explore in overseas territories such as offshore Guyane Maritime in French Guiana.

Total declined to comment immediately.

Macron is pressing ahead with implementing the landmark accord reached by nearly 200 nations in the French capital in 2015 to fight climate change after U.S. President Donald Trump pulled out of the deal.

RELATED: Politicians, Businesses, Anglers Sound Off On Trump’s Paris Decision

As part of the measures, France plans to stop generating electricity from coal by 2022 and reduce to 50% from more than 75% the share of nuclear in its electricity generation, while favoring the increase of renewable power in its electricity mix.