Mr Zapatero wants to unveil a new cabinet on Saturday
Spain's Jose Luis Rodriguez Zapatero faces a second parliamentary ballot to be confirmed as PM after failing to win enough MPs' votes in the first round.
Analysts say he is assured of winning the next ballot on Friday.
As expected, he fell short of the absolute majority of 176 needed for a first round win but only needs a simple majority in the second vote.
A total of 168 MPs voted in favour of Mr Zapatero, while 158 voted against and 23 abstained.
Mr Zapatero's Socialists won 169 seats in Spain's 9 March general election, five seats more than in 2004 but still seven short of an outright majority in parliament.
In Wednesday's vote at the 350-seat lower house, the main opposition conservative Popular Party, which captured 154 seats in the election, voted against Mr Zapatero.
Smaller Catalan and Basque nationalist parties, whose support could have given him victory, abstained. One Socialist lawmaker was not in parliament to vote.
Mr Zapatero also led a minority government in the last parliament when he had to seek the support of smaller parties to pass laws on a case-by-case basis.
Before Wednesday's vote, Mr Zapatero told MPs the slowing economy and the fight against the armed Basque separatist group Eta were priorities for his second term.
If he wins Friday's ballot, he has said he will announce the make-up of his new cabinet a day later after being is sworn in by Spain's head of state, King Juan Carlos.
After more than a decade of strong growth, Spain's economy is showing clear signs of slowing down, particularly in the key construction industry.