MADRID -- Spanish Prime Minister Mariano Rajoy will face a vote of no confidence after courts ruled that the governing Popular Party profited from a large kickbacks-for-contracts scheme, the Socialist opposition announced Friday.

A spokeswoman said the PSOE party had filed for the vote in parliament one day after the country's National Court convicted 29 businesspeople and former PP officials for fraud, tax evasion and money laundering among other crimes.

The challenge puts Rajoy's future on the ropes, but Socialist leader Pedro Sanchez will need to convince other opposition parties to back his 84 votes in the 350-seat national congress in order to sack the conservatives from the government.

The anti-establishment Podemos party, with 67 seats, has already announced that it would vote to sack Rajoy. But with its challenge, PSOE is also pushing the pro-business Ciudadanos (Citizens) party to decide whether to back or not the vote, which needs at least 175 votes to succeed.

Ciudadanos has until now supported the prime minister's minority government in parliament, but the criticism of its leader Albert Rivera has increased in step with his party's newfound popularity in recent polls.

Friday's move comes after a roller-coaster ride this week for Rajoy's PP, whose win on Wednesday of a key approval for the 2018 national budget had secured, in theory, enough breathing space for him to survive until the end of the term, in 2020.

But the setback came less than 24 hours later in the form of a 1,687-page ruling on the so-called Gurtel case, considered one of the gravest corruption episodes in Spain's modern history.

The judges issued prison sentences totalling 351 years and a 245,000-euro fine (US$ 287,000) for the conservative party in power, which the ruling describes as a "profit-seeking participant" in the scheme.

The verdict also considered that a network involving companies and party officials was established to arrange travel and organize events for PP in exchange for public contracts.

In some of the most damaging parts of the ruling, the judges also said that PP ran a slush fund at least until 2008 and questioned the credibility of Rajoy when he denied knowing that the scheme was in place during a court hearing where the prime minister testified as a witness.

The convictions immediately triggered turmoil for the embattled government of the 63-year-old prime minister, who is combating separatist defiance in Catalonia and has for years defended his party against dozens of corruption allegations.

The ruling party has said it will appeal the part of the verdict that found it was a profit-seeking participant in the scheme. Rajoy has not made public comments since the court decision but the prime minister's office said in a statement on Thursday that nobody in the current administration or in the party's leadership was aware of any illicit practice.