MARIANO RAJOY, Spain’s conservative prime minister, likes to say that he “owes nothing to nobody”, a reference to his independence from the Catholic church, corporate Spain and the regional barons of his Popular Party (PP). Yet to many Spaniards those words now ring hollow. Handwritten account-books purported to have been kept by Luis Bárcenas, the PP’s former treasurer, have been leaked to the press. They seem to show that for more than a decade the party’s leaders received payments—around €25,000 ($34,000) a year in Mr Rajoy’s case—from a slush fund whose donors were mainly construction magnates (see article). Mr Rajoy, who has a reputation for personal honesty, insists the allegation is false, that he has never received cash he did not declare, and that the accounts are “apocryphal”. He has promised to publish his tax returns and the party is organising an external audit.

Some of those on the list have confirmed that they received payments. But the list may have been embellished; or, if payments were made, they may have been for expenses, duly declared and receipted. Still, the awkward fact for Mr Rajoy is that until 2011 he worked closely with Mr Bárcenas, a man with €22m in a Swiss bank account, according to a judge, and under investigation in a separate corruption scandal involving PP workers. A former PP parliamentarian has also claimed that the party’s leaders received “top-up” payments in cash.

Mr Rajoy has brushed off opposition calls that he should resign. Elected only 15 months ago, he has an absolute majority in parliament. A poll this week found that the affair has cost Mr Rajoy’s party a fifth of its diminishing public support in a month, but the opposition Socialists are no more popular. Having introduced harsh measures to stabilise the economy, Mr Rajoy is betting on a recovery well before the next election in 2015. By then, he may calculate, the furore will have died down. The amounts involved are not neglible, but Spanish corruption is hardly in the Italian league. His word will be tested by the judiciary—but that will take many years.

Open up Spain’s books

Regardless of Mr Rajoy’s guilt or innocence, that is not good enough. To restore the credibility of his government, the prime minister should set up a swift and independent public inquiry. That is not a Spanish habit, but it should be.

Around 6m Spaniards are officially unemployed, and others face salary cuts as a result of the country’s grinding recession and housing bust. Spaniards—and other Europeans, who have bailed out Spain’s banks—have a right to know whether the construction companies which inflated the housing bubble bankrolled the PP and, if so, what they got in return.

The economic crisis has exposed flaws in many of the institutions put in place during the country’s transition to democracy in the 1970s. Lax moral standards have affected the monarchy—King Juan Carlos’s son-in-law is being investigated for corruption—and the judiciary, whose head resigned last year for using public funds for private trips. Spain’s democracy has given too much unaccountable power to the two main parties. Not only did they colonise the now-broken cajas (savings banks), the judiciary and the civil service, but they also developed a sense of entitlement, never bothering to put in place proper rules for their financing. (The Socialists and Catalan nationalists are unlikely to be much cleaner than the PP.)

The problem facing Spain is that the only people who can clean up this mess are those who created it. Alongside a proper inquiry, Mr Rajoy should start cross-party talks to reform the party system. Otherwise both he and his traditional opponents may drown in a wave of angry populism.