Spain's caretaker PM Pedro Sánchez has failed to secure the parliamentary votes required to form a government after a coalition deal was rejected.
The Socialist leader needed the backing of the left-wing Podemos party, but its ministers abstained in Thursday's vote, describing the deal as "unacceptable".
Mr Sánchez's PSOE party gained the most seats in April's election, but fell short of a majority.
He now has two more months to find a solution or face a general election.
It would be the country's fourth in four years.
Speaking ahead of Thursday's vote, Mr Sánchez said he was "sorry" that a coalition deal could not be reached with Podemos.
"We have demonstrated a noble willingness to reach a deal," he said, adding that his party's proposals had been rejected "one after another".
Podemos said its ministers had only been offered "inexistent or empty" roles within the government, with leader Pablo Iglesias suggesting the Socialists had shown his party a lack of "respect".
Mr Sánchez lost his first post-election confidence vote on Tuesday and lost his second by 155 votes to 124, with 67 abstentions. The session in parliament was adjourned after his defeat.
How did we get here?
Thursday's result follows weeks of fractious negotiations and political turmoil.
On Wednesday, coalition negotiations broke down, with Mr Sánchez's Socialists rejecting Podemos's demands for key posts within government.
The Socialist party's acting Deputy Prime Minister, Carmen Calvo, said Podemos "have literally asked us to give them the government" rather than form a coalition together.
A number of smaller parties had said they would back Mr Sánchez, but only if a deal were agreed with Podemos. Spain's right-wing parties, meanwhile, refused to support him.
While Tuesday's vote had required Mr Sánchez to secure an absolute majority of 176 seats in Congress's 350-seat parliament, Thursday's ballot required a simple majority of support from lawmakers.
What were the sticking points?
In return for joining a coalition, Podemos had asked for key positions such as deputy prime minister and social roles in his cabinet in charge of the environment, equality, employment and economics.
But after last-ditch talks on Wednesday, Podemos said there had been "little progress in the PSOE's proposals", arguing that the Socialists wanted to keep social affairs ministries to themselves. The prime minister insisted he had made a good offer.
Mr Iglesias had already agreed not to seek a ministerial position himself, in an attempt to find a deal.
The two leaders have for months tried to find common ground and tensions spilled into the open during a debate at the start of the week, when Mr Iglesias accused the caretaker prime minister of offering only "cosmetic" roles.
Separately, Mr Sánchez said that Mr Iglesias, whose views on the question of Catalonia's independence starkly differ from his, was "the principal obstacle" to agreeing on a new coalition.
Among the smaller parties with representatives able to vote in parliament on Thursday were the conservative Popular Party (PP), the right-of-centre Ciudadanos (Citizens), the centre-left separatist Catalan Republican Left (ERC) party and the far-right Vox.
Why is Catalonia so important?
The future of Spain's semi-autonomous north-eastern region has been politically explosive ever since Catalonia's leaders held an independence referendum in October 2017. The vote had been outlawed by Spain, but the separatist leadership went ahead with it and then declared independence from Spain.
The issue was a key reason why this year's snap election took place, because Catalan separatists withdrew their support at a key moment in February. A dozen Catalan leaders went on trial in Madrid the same month, facing charges including rebellion and sedition, and separatist MPs wanted concessions from the government.
Mr Sánchez has sought to lower tensions with the region and has faced criticism from other political opponents.
His administration has engaged with the pro-independence government, holding talks with current Catalan president Quim Torra - prompting PP leader Pablo Casado to label him "the biggest villain in Spain's democratic history".
Ciudadanos has also accused Mr Sánchez of siding with "enemies of Spain" and wanting to "liquidate" the country.