Spain’s prime minister has been ousted in a vote of no confidence following a corruption scandal.
Mariano Rajoy admitted defeat ahead of the vote on Friday morning, after six-and-a-half years in the top job.
He is the first Spanish prime minister to lose such a vote.
The vote will hand power to the opposition Socialists, led by Pedro Sanchez, thanks to a narrow majority in the 350-lower seat house.
The motion, called by Mr Sanchez, won 180 votes for, 169 against and one abstention.
Mr Sanchez is expected to take office by Monday and appoint his cabinet next week.
Mr Rajoy told the Spanish parliament he was proud of his record.
“It has been an honour to leave Spain better than I found it. Thank you to all Spaniards and good luck,” he said.
The vote of no-confidence came after 29 former members of his conservative Popular Party were convicted of corruption last week.
Spain’s National Court found bribes were offered to former Popular Party oficials in exchange for public contracts.
The party also received a hefty fine as a beneficiary of the kickbacks-for-contracts scheme.
Mr Rajoy became Spain’s first sitting Prime Minister to stand witness in a trial over the corruption cases, believed to have taken place between 1999 and 2005, and many called for him to resign.
He says the corruption accusations concern only a tiny number of politicians and no current members of government.
“The PP has had corrupt people, I acknowledge it, but the PP is not a corrupt party,” he said.