Spain's new parliament will vote on whether to grant socialist leader Pedro Sanchez a second term as prime minister on July 23, the speaker of the chamber announced Tuesday.
Parliamentary speaker Meritxell Batet told reporters the debate over Sanchez's candidacy would begin on July 22 and the vote would take place the following day.
If Sanchez fails to get an absolute majority -- 176 votes or more -- he will only require a simple majority -- more "yes" than "no" votes -- in a second vote two days later, she added.
"Spain needs a Government as soon as possible to continue advancing towards equality," Sanchez tweeted in response to the announcement.
With no parliamentary majority, outgoing premier Sanchez may struggle to find the support he needs in the first vote.
Although his Socialist Party won the most seats in the April 28 election, that was just 123 seats in the 350-seat assembly.
To be sworn in again as prime minister Sanchez will need the support of far-left Podemos -- which has 42 seats -- and several other smaller, regional parties.
But Podemos wants to be part of a ruling coalition, a condition Sanchez has refused.
The simple majority required in the second vote means Sanchez could be voted prime minister if the main opposition conservative Popular Party (PP) and centre-right Ciudadanos simply abstained from voting.
But the two parties have so far refused to abstain from voting to make it easier for Sanchez to be sworn in.
Sanchez wants to avoid relying on the abstention of the Catalan separatist parties, as the right routinely accuses him of being held hostage by the separatists.
Sanchez came to power in June 2018 with the help of the separatists by ousting conservative prime minister Mariano Rajoy in a no-confidence vote.
But it was the Catalan separatists who triggered the snap polls in April by refusing to back his 2019 budget.
If Sanchez is not sworn in within two months of the first investiture vote, fresh elections must be called in November -- and Spain has already held three national elections in the past three and a half years.
Spain has never had a coalition government since it returned to democracy following the death of longtime dictator Francisco Franco in 1975.