1.2229973-2239353935
Prime Minister Mariano Rajoy. Image Credit: AP

Madrid: The leader of Spanish Socialist party Pedro Sanchez became prime minister on Friday after centre-right Mariano Rajoy was voted out of office in a closely fought no-confidence motion triggered by a long-running corruption trial.

The motion, called by Sanchez, won 180 votes for, 169 against and 1 abstention.

Sanchez is expected to take office by Monday and his cabinet appointed next week.

Earlier in the day Rajoy had admitted defeat ahead of the vote, saying it had been "an honour" to serve the country.

"The no-confidence motion is likely to go through, which means Mr. Pedro Sanchez will be the new prime minister," he told parliament.

The Socialist party leader, Rajoy's arch-rival who called for the vote, is poised to take over as prime minister.