Rajoy is likely to be ousted as the Spanish Prime Minister as the Basque party turns against him

Mariano Rajoy’s controversial and scandal-mired tenure as Spanish prime minister seemed all but certain to be entering its final hours on Thursday afternoon when a small Basque party threw its weight behind a no-confidence motion tabled after Rajoy’s party was found to have profited from a huge corruption racket.

After hours of suspense, the Basque Nationalist party (PNV) revealed it had decided to back the motion proposed by the opposition socialist party, PSOE, delivering the handful of votes required to oust Rajoy of the People’s party (PP) and replace him with the PSOE leader, Pedro Sánchez.

The PNV’s five votes – together with the support of groupings including the anti-austerity Podemos party, the two Catalan pro-independence parties and another Basque party – gave the PSOE 180 votes in Spain’s 350-seat congress, four more than were needed.

Rajoy, who made a defiant appearance in parliament during the morning session, was absent from the chamber when the PNV announced its decision shortly after 5pm.

The party said it had never sought to play a king-making role in Spanish politics, but felt an ethical and political duty to support the motion.

“This isn’t simple; this isn’t easy,” said PNV spokesman Aitor Esteban. “But we have to do it.” He said last week’s court verdict, confirming the PP had benefited from a corruption scam, had marked “a before and an after”.

A Spanish government spokesman said Rajoy was not considering his resignation despite being on the cusp of losing the vote in parliament.

The spokesman, who spoke on condition of anonymity because he was not authorised to be named in media reports, said Rajoy planned to address the lower house on Friday before the vote.

Rajoy had earlier accused the PSOE of opportunism, reminding it of its own corruption scandals.

“With what moral authority are you speaking? Are you perhaps Mother Teresa of Calcutta?” he asked. “There have been corrupt people in the PP, but the PP is not a corrupt party,” he said.

Sánchez called for “democratic regeneration” as he sought the backing of MPs, saying: “Resign, Mr Rajoy. Your time is up.”

He said Rajoy had failed to accept responsibility for the PP’s corruption, which was made public last week when one of its former treasurers was sentenced to 33 years in prison for fraud and money laundering. The party was fined €240,000 (£210,000) after judges at Spain’s highest criminal court ruled it had benefited from the kickbacks-for-contracts scheme.

Rajoy accused Sánchez of using the motion to propel himself into government without an election. “Mr Sánchez is being driven by his eagerness to become prime minister … He wants to be prime minister without having to resort to the ballot box, because even kids know he’ll never win at the ballot box.”

However, Sánchez’ promised to stick to Rajoy’s recently approved budget – which will bring increased investment to the Basque country – as well as signalling a willingness to engage with Catalonia’s pro-independence government.

Although Podemos backed the motion, the centre-right Ciudadanos party called instead for a snap election and refused to align itself with “populists and nationalists”.

If Sánchez’s motion is formally approved on Friday, he will become prime minister next week. He promised to call a general election if he succeeded Rajoy but said his party would first spend a few months concentrating on social and educational reforms before taking the country to the polls.

Rajoy’s minority government has been beset by corruption scandals over recent years. Last July, Rajoy became the first serving Spanish premier to testify in a criminal trial after being called to give evidence in the kickbacks-for-contracts case. In their ruling last week, judges in the case questioned the credibility of his testimony.

At the end of April, the PP president of Madrid’s regional government stepped down after revelations that she had apparently being caught stealing two tubs of face cream seven years ago. Cristina Cifuentes had been under intense pressure to quit over allegations that she faked her master’s degree.

One of her predecessors, Esperanza Aguirre, stepped down as head of the regional party two years ago, admitting that “corruption is killing us”.

Although the PP won by a landslide in the 2011 general election, it failed to achieve outright victory in the December 2015 election or the one that followed six months later.

Spain spent 10 months in the hands of a PP caretaker government until October 2016, when Rajoy was returned to office after the PSOE abstained from the investiture vote to break the political paralysis and avoid a third election.