FILE PHOTO: A man fills up his car with diesel at a petrol station in Madrid, Spain, May 29, 2018. REUTERS/Sergio Perez

MADRID (Reuters) - Spain plans to propose a ban on sales of petrol, diesel and hybrid cars from 2040, government sources said on Tuesday, joining a string of countries taking aim at polluting vehicles to help cut greenhouse gas emissions.

The plan is included in a draft document for a law on climate change which Socialist Prime Minister Pedro Sanchez’s government hopes to present to parliament by the end of the year.

“Some of the most important necessary changes affect transport,” the document said. “From 2040, the registration and sale in Spain of passenger cars and light commercial vehicles that directly emit carbon dioxide will not be permitted.”

Once finalised, the climate change law will require approval by parliament, where Sanchez holds less than a quarter of the seats.

Sanchez has struggled to find support for any major proposals, including next year’s budget, in the face of opposition led by the conservative People’s Party which dominates the upper and lower houses.

Britain and France have already pledged to ban petrol and diesel cars from 2040, which will mean big changes for the global car industry and put a squeeze on oil producers' profits. [reut.rs/2RTt8II]

Some British politicians have said London should bring the ban forward to 2032, a more ambitious deadline already adopted by Scotland, while Denmark wants to make the move by 2030.

Underlining his green ambitions, Sanchez brought environment and energy together into one ministry, which has since passed measures aimed at reducing electricity prices and favors promoting renewable energy.

Under the current climate change plan, Madrid aims to cut greenhouse gas emissions to at least 20 percent below 1990 levels by 2030. The European Union as a whole aims to reduce emissions by at least 40 percent by 2030.