Spain PM Mariano Rajoy faces defeat in Friday no-confidence vote
Spanish Prime Minister Mariano Rajoy is set to be forced out of office in a motion of no confidence.
On Friday he congratulated Socialist Party leader Pedro Sánchez, who will become prime minister after the ballot.
Mr Sánchez, who needs 176 votes, filed the no-confidence motion after Mr Rajoy's People's Party (PP) was implicated in a corruption scandal.
Mr Rajoy will be the first prime minister in modern Spanish history to be defeated in such a motion.
On Friday, as debate on the no-confidence motion resumed for a second day, he told parliament that it has been "an honour to leave a better Spain than I found".
He said me hoped Mr Sánchez would be able to "say the same".
The opposition Socialists have secured support for the non-confidence motion from various smaller parties, including the Basque Nationalist Party - which has a crucial five seats in parliament.
Why was the vote called?
Mr Sánchez says Mr Rajoy, 63, had failed to take responsibility for his party's involvement in the scandal, which returned under scrutiny last week after one of its former treasurers was given a 33-year jail sentence.
The High Court in Madrid convicted Luis Bárcenas of receiving bribes, money laundering and tax crimes.
The case centred on a secret campaign fund the PP ran from 1999 until 2005.
Many Spanish voters, exasperated by corruption scandals involving the traditional centre-right PP and centre-left Socialist parties, have abandoned them for newcomers like the left-wing Podemos (We Can) and centrist Ciudadanos (Citizens), as well as regional parties.
Who is Pedro Sánchez?
Analysis by Guy Hedgecoe, BBC News, Madrid
Pedro Sánchez emerged as a virtual unknown to win the Spanish Socialist party premiership in 2014. The photogenic economist and former basketball player won members over with a promise to unite a divided party and put the Socialists back in power.
Yet he subsequently suffered two humbling election defeats, in 2015 and 2016. He was eventually forced to resign after his refusal to back Mariano Rajoy in an investiture vote plunged the country into a prolonged political stalemate and his party into bitter infighting.
Months later he confounded his many critics by returning to win the Socialist primary. Spain's constitution states that the party presenting a no-confidence motion must be prepared to govern and replace the deposed prime minister if a parliamentary majority backs it.
Therefore this moderate but ambitious 46-year-old from Madrid is set to be Spain's new prime minister, despite the fact that his party commands less than a quarter of seats in Congress.
Could Mariano Rajoy step down?
"Resign, Mr Rajoy, your time is up. Resign and this no-confidence motion ends here," Mr Sánchez said during the two-day debate that began in parliament on Thursday.
"Staying on as prime minister is harmful and is a burden not only for Spain but also for your party."
Mr Rajoy insisted he would stay put and accused the Socialists of opportunism.
"Mr Sánchez is concerned because he is not doing any better in the polls and he has realised that he will never reach government through elections," he added.
Mr Rajoy's resignation ahead of a vote would prevent Mr Sánchez from taking power and usher in a caretaker period of weeks, possibly months, before a new PM is sworn in.
If he loses, however, Mr Sánchez is likely to replace him immediately.
The PM did not return to parliament for the afternoon session. Instead he remained at a restaurant for about 10 hours, with various cabinet members visiting him over lunch and during the course of the afternoon, Spanish media reported.
Also on Thursday, the Basque Nationalist Party (PNV) confirmed that it would support the no-confidence motion.
"We believe we are responding to what most Basques want and best complying with our responsibility by voting yes [to the motion]," said party spokesman Aitor Esteban.
Mr Rajoy currently has the support of the PP, Ciudadanos and two regional parties, which between them can only muster 169 votes.