Clean energy advocates celebrated after a pro-renewables party got the highest share of the vote in Spanish elections over the weekend.

The center-left Spanish Socialist Workers' Party (Partido Socialista Obrero Español, or PSOE) picked up almost 29 percent of votes and 123 seats in Spain’s 350-seat congress, trouncing its traditional opposition, the right-wing People’s Party (PP), which secured just 66 seats.

While the result leaves the PSOE short of the 176 seats it would need to govern with a majority, it nevertheless gives the party a clear mandate to steer national policy for the next four years.

That is “very positive for the energy transition,” said Daniel Pérez Rodríguez, chief legal officer at the independent green energy retailer Holaluz.

Spain’s renewables market, at one point among the largest in the world, has been seeing a resurgence after years of neglect at the hands of the PP. The party axed once-lavish subsidies in 2013 and introduced a system of reviews that scared off investors.

The PSOE seized power from the PP last June after a vote of no confidence triggered by a corruption scandal. But PSOE leader Pedro Sanchez, governing with only 84 representatives in congress, was forced to call elections when lawmakers refused to back his budget proposals.

The PSOE’s road map includes a major commitment to renewable energy.

Last year Sanchez merged environmental and energy affairs into a single government department for ecological transition whose head, Teresa Ribera, has led moves to end longstanding regulatory uncertainty surrounding renewable investments.

In its campaign manifesto, the PSOE has pledged to achieve a 2030 target of 35 percent renewables in the final energy mix and 74 percent in electricity generation. The manifesto also calls for 100 percent of electricity to come from renewables by 2050.

Elsewhere, the document proposes electricity market reform and promises a solution to the difficulties experienced by small investors who lost out when renewable subsidies were axed in 2013, paradoxically because of a poor regulatory framework put in place by the PSOE.

Next steps clouded by political fracturing

Ribera, a former secretary of state for climate change and ex-director of the Institute of Sustainable Development and International Relations, is seen as a safe pair of hands to steer the pro-renewables initiatives.

There is uncertainty, however, over whether she will retain her post if Sanchez has to let other parties into his administration. The highly fractured nature of Spanish politics means there are several options on the table.

A decade ago, Spain had the kind of two-party system still prevalent in the U.S., with PSOE and PP occupying roughly the same ideological space as the Democrats and the Republicans, respectively.

But these latest elections saw five national parties sharing almost 86 percent of the vote.  A further 10 percent went to nine parties looking to represent Spanish autonomous communities at the national level.

They included a strong showing for two parties committed to splitting Catalonia from the rest of Spain, a topic that has become a flashpoint in Spanish politics.

Against this backdrop, the simplest option for Sanchez would be to gain a majority by joining forces with a rising center-right party called Ciudadanos ("Citizens"), which came third after the PP with almost 16 percent of votes and 57 seats in parliament.

Ciudadanos, led by stock market favorite Albert Rivera, came close to forming an alliance government with PSOE in 2015.

It’s a combination that would go down well with foreign investors, said Mortimer Menzel, partner at the renewable energy financial advisory firm Augusta & Co., by providing a right-wing balance to PSOE’s more left-wing inclinations.

Such a pairing looks unlikely at present, though. It would be unpopular with PSOE followers, who chanted “not with Rivera” as Sanchez took the stage to address them following his victory.

And it would be even more challenging for Rivera, who has been vocal about fighting PSOE-led attempts to negotiate with regional separatists and who now appears keen to assume the PP’s role of principal opposition, with a chance of winning the next election.

Good news for renewables

Another option for the PSOE is to build a government with Unidas Podemos, a far-left party that is keen to form an alliance.

This, however, would still fall short of a full majority and would force Sanchez to add at least one other party to the mix from among the main separatist groups, an unpalatable prospect given the divisiveness of the Catalan independence issue.

A wrinkle in Spanish electoral law might allow the PSOE and Unidas Podemos to form a government on their own if the separatist parties abstain from voting in a runoff that can be claimed by a simple majority. That, too, is a high-risk strategy.

Finally, the PSOE may attempt to go it alone in a minority, forging tactical alliances where needed. The party’s Vice President, Carmen Calvo, said this would be the PSOE’s preferred route for now.

Whatever the outcome of negotiations, it is likely to spell good news for renewables in Spain. Although Spanish consumers are still seeing high electricity costs, the big concern in these elections was the rise of a far-right party, Vox.

The party ultimately secured a presence in parliament but polled below expectations, gaining 24 seats with 10 percent of the vote.

With Vox and Catalan independence as the main talking points, renewables barely got a mention on the campaign trail, and the main parties involved in policymaking are expected to wave through future legislation on the energy transition.

The Spanish Association of Renewable Energy Companies, APPA, said it hopes the new government would reform the market to favor a transition toward renewables, while improving regulatory stability to allow greater investment and job creation.

And Augusta & Co.'s Menzel told GTM: “For renewable energy, having the socialists leading a government is the best option. The PSOE approach to renewables has always been better than the approach of the PP.”