OUSTED Spanish prime minister Mariano Rajoy is quitting as leader of the conservative People’s Party (PP) after it was rocked by a corruption scandal.

He told his party he would leave once a successor is elected at a forthcoming succession conference, ending a political career that spans more than 30 years.

“The time has come for me to put an end to this story: PP must move forward under a new leadership,” Rajoy said.

“It’s the best for PP and for me. And I believe that it’s the best for Spain as well. And that’s all that matters.”

He was criticised for his handling of the Catalan independence crisis and the imposition of direct rule from Madrid, as well as the “preventative detention” of leading Catalan politicians and public figures.

But it was the scandal known as the Gürtel case that ultimately led to his downfall and the success of a no confidence motion by Socialist Party leader, now Prime Minister, Pedro Sánchez.

Attention will now fall on his likely successor, and names already in the frame are his deputy as PM Soraya Sáenz de Santamaría, who was in charge of direct rule in Catalonia for seven months, and María Dolores de Cospedal, PP secretary general and defence minister.