The Spanish attorney-general has resigned after the Supreme Court found him guilty of leaking confidential information in a tax fraud case brought against the partner of a political rival of the Socialist prime minister.

The verdict is a blow to the corruption-tainted minority government of Pedro Sánchez, who appointed Álvaro García Ortiz in 2022 and has repeatedly insisted on his innocence.

The unprecedented trial has gripped the politically polarised country. The verdict has deepened a row over the independence of the judiciary. It is the first time in Spain’s modern history that the top prosecutor has faced a criminal trial and the case is one of several that have implicated people close to Sánchez.

The Supreme Court suspended García Ortiz from office for two years. It ordered him to pay a fine of €7,300 and compensation of €10,000 to Alberto González Amador, the partner of Isabel Ayuso, the conservative head of Madrid’s regional government.

Isabel Díaz Ayuso in front of the Spanish and Madrid flags.

Isabel Ayuso

MARTA FERNANDEZ/EUROPA PRESS/GETTY IMAGES

Ayuso, who has been tipped for a national leadership role, and her conservative Popular Party (PP) accused Garcia Ortiz of leaking case files about her partner to damage her. They claimed that he sent an email to journalists with personal information about González Amador when the businessman was under investigation for alleged tax fraud. That tax inquiry remains open.

The attorney-general denied wrongdoing. He said that his decision to step down came from “profound respect” for judicial rulings.

After the verdict Ayuso said on X: “Using the apparatus of the state to attack a political rival is characteristic of dictatorships.”

Oscar Lopez, the digital transformation minister, who is close to Sánchez, said: “In this country there are judges … who truly believe that the state is at risk, that the country is falling apart, and that they have to save the homeland and deny the legitimacy of this government.”

Sánchez insisted on García Ortiz’s innocence and suggested that the ruling of the conservative-majority Supreme Court would go to appeal in the left-majority constitutional court. The government’s main coalition partner, the populist left-wing Sumar platform, called it a “judicial coup d’etat”.

Separate corruption investigations targeting the prime minister’s wife, brother and two former right-hand men have threatened to topple Sánchez, who came to power in 2018 promising to clean up Spanish politics.The PP has repeatedly called for his resignation and a snap general election.