FILE PHOTO: A view of Asco village and a nuclear plant, which uses the waters of the Ebro river water to cool it, in Asco near Tarragona January 27, 2010. REUTERS/Gustau Nacarino/File Photo

MADRID (Reuters) - Spain aims to close all seven of its nuclear plants between 2025 and 2035 as part of plans to generate all the country’s electricity from renewable sources by 2050.

Energy Minister Teresa Ribera announced the move on Tuesday, just as the Socialist government gears up to call an early national election in anticipation of losing a budget vote.

Overhauling Spain’s energy system, which generated 40 percent of its mainland electricity from renewable sources in 2018, will require investment of 235 billion euros ($266 billion) between 2021 and 2030, Prime Minister Pedro Sanchez said last month.

Ribera said the government would present a draft plan to combat climate change, which had been due to be sent to the European Union for approval by the end of last year, to parliament on Feb. 22.

Under a draft bill prepared last year, the government aims to ban sales of petrol, diesel and hybrid cars from 2040 and encourage the installation of at least 3,000 megawatts a year of renewable capacity such as wind farms and solar plants.

Phasing out nuclear power, which accounts for a little over 20 percent of mainland Spain’s electricity, was a campaign pledge for the governing Socialists, who took office last summer after toppling their conservative predecessors in a confidence vote.

Spain’s nuclear plants, which started operating between 1983 and 1988, are owned by Iberdrola, Italian-owned Endesa, Naturgy and Portugal’s EDP.