MADRID - Spanish Prime Minister Mariano Rajoy is poised to be ousted from office after a Basque party on Thursday gave its decisive support to a no-confidence motion over a corruption case, making it all but certain to succeed.

The Basque Nationalist Party (PNV) said its five lawmakers would vote against Rajoy. This gives the main opposition Socialist party, which filed the motion, the absolute majority of 176 votes needed for it to pass in a vote scheduled Friday.

“We think that we’re responding to what most Basque citizens want... by voting yes” to the motion, Aitor Esteban of the PNV said during a pre-vote debate at the lower house of parliament.

The Socialists filed the motion last week after a court said it had uncovered a vast system of bribes given to former officials of Rajoy’s Popular Party (PP) in exchange for lucrative public contracts between 1999 and 2005.

The National Court, which deals with major criminal cases, sentenced 29 people with links to the PP, including a former treasurer, to jail. It also ordered the party to pay back 245,000 euros ($290,000) received from the scheme to help finance election campaigns.

Rajoy became Spain’s first sitting prime minister to give evidence in a trial when he was called as a witness last year, prompting calls for him to resign. In its ruling, the court said the credibility of Rajoy’s testimony “should be questioned”.

Earlier on Thursday, Socialist leader Pedro Sanchez demanded Rajoy step down, arguing he had lost credibility after the court ruling, the latest in a string of graft scandals affecting the PP.

“Resign, Mr Rajoy, your time is up. Resign and this no-confidence motion ends here, today and now,” he said during the debate in parliament. “Your isolation, Mr. Rajoy, is the epitaph of a political period, yours, which is over,” the 46-year-old former economics professor added.

In a bid to secure the PNV’s support, Sanchez also vowed to stick to Rajoy’s 2018 budget, which included concessions to the Basque Country and an increase in pensions demanded by the tiny party.

The PNV, which governs the northern Basque Country with the Socialists, gave Rajoy the crucial backing he needed to pass the budget earlier this month.

The Socialists, who hold 84 of the parliament’s 350 seats, also have the support of anti-establishment party Podemos and a string of regional parties, including two Catalan separatist groupings.

“The party is over,” said Joan Baldovi, a representative of tiny regional party Compromis, an ally of Podemos.

Sanchez has pledged to call a fresh election if the motion succeeds but only after governing long enough to restore “institutional stability”.

Bar any last minute u-turn, Rajoy will become the first Spanish premier to lose a no-confidence vote.

There have been three other such votes since Spain returned to democracy following the death of long-time dictator Francisco Franco in 1975, including one against Rajoy last year.

During Thursday’s debate, Rajoy said the corruption case “does not concern members of the government” and repeated the PP’s argument that only a tiny number of its politicians have been tainted by corruption.

“The PP has had corrupt people, I acknowledge it but the PP is not a corrupt party,” he said, before accusing Sanchez of “opportunism at the service of personal ambition”.

Rajoy also hit back by listing the many graft cases involving the Socialists over the years.

“Are you Mother Teresa of Calcutta? With what moral authority do you speak?” he asked Sanchez.

Rajoy has so far refused to step down before the vote on the no-confidence motion. If he did a PP government would go into caretaker mode until new elections are held.