As it prepares to enter into tough coalition negotiations, will the conservative Popular Party (PP) manage to unblock months of political paralysis triggered by inconclusive December polls and strike a pact with rival groupings?
Going forward, here are the PP's likely strategy and challenges:
Socialist party is key
PP leader and acting prime minister Mariano Rajoy has said he will quickly contact the Socialists and centre-right upstart Ciudadanos to propose forming a “grand coalition.”
He formulated the same proposal after December polls, but both groupings refused.
This time round, though, the PP has a bit more clout with the 137 seats it won – 14 more than in December – compared to both the Socialists and Ciudadanos which lost seats.
If all three came together, they would have an easy absolute majority in the 350-seat parliament to push their government through.
The Socialists, though, are unlikely to agree, having campaigned for “change” and criticised the repeated corruption scandals to have hit the PP since it came to power in 2011.
Rajoy would then have to make concessions to the Socialists, which came second in the elections with 85 seats, in exchange for their abstention in the vote of confidence necessary to approve a new government.
If the Socialists still refuse, he could try joining forces with Ciudadanos and small regional parties only and get a minority government through with the abstention of one or two Socialist lawmakers — which is all such a coalition would need.
Sense of urgency
Rajoy has insisted he wants to avoid extending the political limbo at a time of fragile recovery in Spain and uncertainty in Europe following the shock Brexit vote.
“It is crucial to have a government at the end of July or at the beginning of August at the latest, because the challenges ahead are significant,” he told reporters.
Rival parties had insisted before the election they wanted Rajoy to go, whatever the outcome, and the Socialists pledged this again on Monday.
“We won't support Rajoy,” said Cesar Luena, number two of the Socialist party.
Asked whether the Socialists would consider abstaining, however, Luena said this would be an issue they would discuss when the time came.
“The most normal outcome would be that Mariano Rajoy governs with our abstention, but this abstention would only be justified once we will have demonstrated that there is no other choice,” said a person close to Socialist party chief Pedro Sánchez, who wished to remain anonymous.
Ciudadanos had also said it wanted Rajoy out, but party chief Albert Rivera said on Monday he was willing to “talk about reforms” and added he had never set Rajoy's departure as red line.
Sidelined for left-wing coalition with Ciudadanos?
After the last elections, Sánchez teamed up with Ciudadanos and tried to get Podemos on board.
But the anti-austerity party's chief Pablo Iglesias eventually decided not to support his government proposal and it failed.
Opinion polls before the latest elections had suggested a far-left coalition led by Podemos would leapfrog the Socialists and come second, thus becoming the country's main left-wing force.
But that didn't happen as more than a million of the coalition's voters appeared to have abstained, meaning it came third again with the exact same number of seats.
Could the Unidos Podemos coalition now be pushed into a coalition government with the Socialists and Ciudadanos, or at least abstain if the other two groupings got together again?
“It's the moment to be humble,” Pablo Echenique, Podemos' number three, said on Monday.
“We are open to the possibility of forming a progressive government in this country because we believe that corruption combined with austerity and wrong economic policies… is a tragedy for our country.”
Still, this scenario remains highly unlikely, as the Socialist party deeply mistrusts a party it knows wants to replace it.
Third round of elections?
If negotiations break down like they did after December elections, Spain would have no choice but to go back to the polls… for a third time.