June 1 (UPI) -- Spanish Prime Minister Mariano Rajoy was ousted from office Friday after losing a vote of no confidence in parliament.
Rajoy will be replaced with Pedro Sanchez, the leader of Spain's opposition Socialist PSOE party, which motioned to remove Rajoy from office.
Sanchez's motion won the support of 180 lawmakers - four more than the 176 needed in the 350-seat parliament. One lawmaker abstained and 169 others opposed.
This vote of no confidence marks the first time in Spanish democratic history that a head of government has been removed.
"It has been an honor to be the prime minister of Spain," Rajoy said before the vote. "It has been an honor to leave a better Spain than the one I found. I hope that my successor will be able to say the same when his time comes."
Rajoy, 63, was removed following years of corruption allegations against his Popular Party that culminated last week with a court convicting former aides of running slush funds to help finance Popular Party election campaigns.
Before the vote, Popular Party spokesman Rafael Hernando asked Sanchez to withdraw the vote, adding he was proud of Rajoy.
"He is an honest man who has worked tirelessly to rebuild a country that the PSOE left devastated," Hernando said.
Margarita Robles, a spokeswoman for the Socialist PSOE Party, said Spain "does not deserve a prime minister who's not here and who lies in the courts of justice to cover corruption."