Spanish Prime Minister Mariano Rajoy has been forced out of office by a no-confidence vote in parliament.
Socialist leader Pedro Sánchez needs a majority of 176 votes to become leader.
In parliament, the Basque Nationalist Party (PNV) said its five lawmakers would vote against Rajoy, who was conspicuously absent from the lower house after earlier launching a staunch defence against the motion, scheduled for Friday.
Although Rajoy survived a similar no-confidence vote previous year, Friday's ballot draws a line under his rollercoaster time in office which began in 2011 and saw him implementing drastic spending cuts before winning re-election in 2015 and 2016.
The 46 year-old Sanchez is now the prime minister in waiting.
"Handsome", filed the motion to force Rajoy out of office, after the then-prime minister's conservative Popular Party (PP) was embroiled in a corruption scandal.
Sanchez, until now the leader of the largest opposition party, could be sworn in by King Felipe VI as early as Saturday and appoint his Cabinet over the coming days.
Trump moving ahead with plan to slap tariffs on Chinese goods
Trade Representative's chief agricultural negotiator, Gregg Doud; and Commerce Department Deputy Assistant Secretary Alan Turley. The statement did not reiterate China's own previous threats to impose $50 billion in retaliatory tariffs on USA goods.
There were 169 no votes and one lawmaker abstained.
In order to push through the no-confidence motion, the Socialists, who hold just 84 of the parliament's 350 seats, have had to cosy up to parties they have previously clashed with, like Catalan separatists and the anti-establishment Podemos. Dozens of people tied to his party have been sentenced to years in prison.
Mr Sánchez tabled the motion of no confidence after Mr Rajoy's centre-right People's Party (PP) was implicated in a huge corruption scandal.
"Mr. Sanchez will be the head of the government and let me be the first to congratulate him", Rajoy reportedly told deputies before the no-confidence vote was cast.
It also ordered the party to pay back 245,000 euros ($290,000) received from the scheme to help finance election campaigns.
But his majority - the smallest for a Spanish government since the return to democracy following Francisco Franco's death in 1975, makes it unclear how long his administration can last.
During Thursday's debate, Rajoy said the corruption case "does not concern members of the government" and repeated the PP's argument that only a tiny number of its politicians have been tainted by corruption. "With what moral authority do you speak?" he told Sanchez.