Spain's prime minister has rejected calls for him to step down after text messages emerged showing him comforting a governing party's former treasurer being investigated over a payments scandal.

Spaniards reeling from austerity and severe unemployment have reacted angrily to the development viewing it as greed and corruption, but Mariano Rajoy told reporters on Monday he would not quit.

He insisted after meeting with visiting Polish Prime Minister Donald Tusk that he would "see out the mandate the Spanish electorate gave me".

"This is a stable government that is going to fulfil its obligations," Rajoy said.

Rajoy's comments came as Luis Barcenas, a former treasurer of the ruling Popular Party, testified behind closed doors in the capital Madrid, telling a judge investigating slush fund allegations that he gave 25,000 euros in secret payments to Rajoy and party secretary general Maria Delores de Cospedal between 2008 and 2010.

Rajoy, who says neither he nor other party officials received illegal payments, did not deny exchanging text messages with Barcenas, who is now in jail.

Tone of cronyism 

He insisted that the messages demonstrated that the state "was not bowing to blackmail. This is a serious democracy".

But the text messages, some analysts said, appeared to convey a tone of cronyism.

"Luis, nothing is easy," one message said. "But we are doing what we can. Cheer up."

Analysts are divided over whether the scandal could prompt an early exit for Rajoy.

He led the Popular Party to power in 2011 in a landslide that gave his party an absolute majority in Parliament and no requirement to call new elections until late 2015.

If Rajoy's position as leader becomes untenable, his party could theoretically decide he needs to go and select someone else as prime minister.

It is unlikely that there would be any changes in Spain's tough austerity measures aimed at helping keep the European debt crisis at bay.

Spain has been mired in financial difficulties that saw it edging close to a full-blown public finances bailout last year before Rajoy asked for a 100bn euro to rescue the country's troubled banks.

He also raised taxes and cut public services - all in the name of saving the country from ruin.

The graft allegations come on top of unemployment at 27 percent with the rate double that for those under age 25, plus an ill-fated elephant hunting trip by Spain's king last year seen as a shameless sign of royal excess while the economy tanked.

Source: Agencies