Two former Spanish premiers categorically denied the existence of a slush fund at the right-wing Popular Party Wednesday, as they testified as witnesses in the trial of a former party treasurer.

The case centres on the party's alleged system of parallel bookkeeping used to manage undeclared funds that was run by Luis Barcenas, who served as the PP's financial manager and then treasurer from 1990-2009.

For nearly 20 years, the alleged slush fund was fed by donations from businessmen and used to pay bonuses to PP leaders and collaborators, Barcenas has testified, saying it also funded the renovation of the party's Madrid headquarters.

In a highly-anticipated appearance by videoconference, both former premiers separately denied any knowledge of a party slush fund, saying they had not received or authorised any undeclared cash payments.

"I don't know about any parallel accounting system," insisted Jos? Mar?a Aznar, who served as prime minister between 1996 and 2004.

Luis Barcenas says he gave envelopes of cash to party bigwigs including Rajoy Luis Barcenas says he gave envelopes of cash to party bigwigs including Rajoy Photo: AFP / PIERRE-PHILIPPE MARCOU

"There was no slush fund operating in the Popular Party," testified Mariano Rajoy, who took over the party leadership from Aznar and served as premier between 2011 and 2018.

Rajoy has always denied any knowledge of the system, although Barcenas has testified he was one of those who received envelopes of cash in the period before he became premier.

Aznar also denied the existence of the system of parallel accounting in remarks to a parliamentary inquiry in 2018.

Barcenas is currently serving a 29-year sentence over the so-called Gurtel case involving a vast system of bribes given to former PP officials in exchange for public contracts between 1999 and 2005.

It was that corruption scandal which triggered a 2018 no-confidence vote in parliament that toppled Rajoy and ousted the PP from power, paving the way for the Socialists under Pedro Sanchez to take over.

If Barcenas is convicted, prosecutors want him jailed for another five years. The trial runs run until May.

Jose Maria Aznar, on the left, served as Spain's premier between 1996 and 2004, while Mariano Rajoy was prime minister between 2011 and 2018 Jose Maria Aznar, on the left, served as Spain's premier between 1996 and 2004, while Mariano Rajoy was prime minister between 2011 and 2018 Photo: AFP / SAGRARIO CAGIGAS

Details of the slush fund emerged in the so-called Barcenas papers -- a cache of handwritten ledgers documenting the system which was first exposed by several newspapers in January 2013.

"I gave them an envelope containing the amount they were owed", Barcenas told the court this month, identifying the recipients as eight senior PP figures, among them Rajoy.

He said the payments were made after Rajoy and others entered Aznar's cabinet to ensure their salaries did not drop below a certain level. Previously, they got their MP's salary and were also paid for representing the party, but such an arrangement is illegal for government ministers.

But Rajoy on Wednesday denounced the allegations as "absolutely false", insisting he had "never" received any such payments and calling the idea "delusional".

And Aznar also denied receiving "any salary supplement".

Addressing the judges, Rajoy said he had never heard anyone in the PP mention "this infamous slush fund".

"There is no parallel account, there are only the Barcenas papers and we don't know when he drew them up, nor by what criteria, nor with what objective or purpose," he said, dismissing as false the ledgers where his name appears alongside alleged payments.

Rajoy appeared in court in 2017 as part of the Gurtel case, becoming the first sitting prime minister to take the witness stand in Spain's modern history.

The following year he became the first prime minister in Spain's recent history to be ousted from office in a no-confidence motion.

Current PP leader Pablo Casado has sought to distance himself from the scandal, arguing neither he nor the party's current leadership can be blamed for what happened in the past.