Spain's Prime Minister Mariano Rajoy faced calls to resign Sunday over a slush fund scandal roiling his ruling Popular Party.

The issue blew up again after the publication of friendly mobile text messages he purportedly sent to the disgraced treasurer at the heart of the affair.

The leader of Spain's main opposition Socialist Party, Alfredo Perez Rubalcaba, 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 told reporters in Madrid.

"Mr Rajoy's conduct in this situation can be summarised quite simply: silence, lies, and after what we have learned today, collusion, extremely serious collusion," Rubalcaba said.

Dozens of protesters, outraged by the corruption allegations at a time of recession and record unemployment, rallied outside the Popular Party's Madrid headquarters, chanting "Thieves!" and "Here is Ali Babi's cave!".

The centre-right daily El Mundo newspaper published images of the alleged text messages between Rajoy and Luis Barcenas, the former ruling party treasurer who is in pre-trial detention as part of a separate corruption inquiry.

Barcenas is suspected of running a party slush fund financed by corporate donors who were then rewarded with state contracts. The cash was allegedly used to supplement senior party members' salaries.

According to El Mundo, the prime minister sent supportive messages to Barcenas between May 2011 and March 2013, ending some two months after the scandal erupted.

Rajoy kept in "direct and permanent contact" with Barcenas, El Mundo said.

"Luis, I understand, be strong. I will call you tomorrow. Best wishes," said one of the messages purportedly from Rajoy to Barcenas, dated January 18 this year 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 Rajoy.

The Popular Party, which has ruled with an absolute majority since winning an election landslide in September 2011, hit back at the opposition call for the prime minister to step down.

"It is pitiful that Rubalcaba, in his distress, is calling for resignations in collusion with the lies of a man under police investigation," said Carlos Floriano, the Popular Party's deputy secretary.

Rajoy, backed by his party's solid majority, has resisted calls to answer questions in parliament over the scandal. He is expected to face the press Monday, however, after hosting a visit by Polish Prime Minister Donald Tusk.

Barcenas has been summoned to appear before a judge on Monday after El Mundo last week published what it said was an original page from Barcenas' slush fund ledger and handed the document to the courts.

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

The entries include two payments to Rajoy of 2.1 million pesetas (12,600 euros/$16,200) in 1998.

Coming six months after centre-left daily El Pais published supposed photocopies of the accounts, El Mundo's report said that the original copy challenged claims by the party that the accounts had been fabricated.

Two days earlier, on July 7, El Mundo published an interview in which it said Barcenas admitted the Popular Party had engaged in illegal financing for 20 years,

The Popular Party has repeatedly denied the allegations.

Rajoy, too, denies any wrongdoing.

A Spanish judge remanded Barcenas to custody on June 27 over separate allegations including money laundering and tax fraud. He said the move was aimed at preventing him from fleeing and to preserve evidence.

Barcenas is being investigated over tens of millions of euros he allegedly stashed in Swiss bank accounts.