Spanish prime minister Mariano Rajoy is facing calls to resign or explain his ties to a slush fund scandal roiling the ruling Popular Party, after its jailed former treasurer appeared in court over the affair.

The 58-year-old prime minister has denied any wrongdoing and refused to comment in past weeks on the growing controversy centred on disgraced ex-treasurer Luis Barcenas.

Few Spaniards expect Mr Rajoy to resign given the commanding parliamentary majority he enjoys since leading the party to a landslide electoral victory in November 2011.

But the tentacles of the scandal are nevertheless moving closer to the prime minister after the conservative El Mundo newspaper on Sunday published friendly text messages Mr Rajoy purportedly sent to Barcenas from May 2011 to March 2013, some two months after the scandal erupted.

"Luis, I understand, be strong. I will call you tomorrow. Best wishes," said one of the messages from Mr Rajoy to Barcenas, dated January 18 when El Mundo first published allegations over the slush fund.

"It is not good to try to determine what we will say or to comment on things that must be presented to the courts, which we must all respect," read another message allegedly sent by Mr Rajoy.

On Monday, a police van delivered the 55-year-old Barcenas from his prison in Soto del Real outside Madrid to the High Court to be quizzed by Judge Pablo Ruz as protesters outside chanted "Thieves".

He was summoned after El Mundo last week published what it said was an original page from Barcenas' hand-written slush fund ledgers.

The excerpt purportedly showed extra payments from a secret fund to party officials including Mr Rajoy when he was a minister under then prime minister Jose Maria Aznar in 1997, 1998 and 1999.

Leading daily El Pais earlier published photocopies of the purported ledgers, in which Mr Rajoy appeared as having received a total of 25,200 euros ($35,000) a year between 1997 and 2008.

Demand for Rajoy to step aside, answer questions

The Popular Party has repeatedly denied the secret financing allegations.

The leader of Spain's main opposition Socialist Party, Alfredo Perez Rubalcaba, on Sunday accused the premier of "serious collusion" with Barcenas and said he was severing all contact with the prime minister and his party.

"Given the unsustainable political situation in Spain, the Socialist Party calls for the immediate resignation of Mariano Rajoy as head of the government," he said.

An editorial in leading daily El Pais on Monday demanded an explanation from the premier.

"Out of respect for the democratic system, the citizens and his own party and voters, the head of government must give a true explanation to parliament," it said.

"Otherwise it will be impossible for him to regain his credibility."

Mr Rajoy was expected to face questioning over the affair in a news conference later in the day after hosting a visit by Polish prime minister Donald Tusk.

The corruption allegations have outraged Spaniards suffering in a recession with a record unemployment rate of more than 27 per cent.

Barcenas is already behind bars while under investigation in a separate graft case.

AFP