Rajoy, 58, was in fighting mood as he appeared in parliament, pouring scorn on calls for his resignation over allegations surrounding his ruling Popular Party's disgraced former treasurer, Luis Barcenas.
"I made a mistake in maintaining confidence in someone who we now know did not deserve it," said Rajoy, who for months had resisted even pronouncing Barcenas' name in public.
The grey-bearded prime minister said he was appearing before the special session of parliament to "refute the lies, manipulations and malicious insinuations encouraged by certain political leaders".
The Spanish leader said his conservative Popular Party did pay its officials extra money in addition to their salaries for "work done". But he denied allegations that he received illegal payments from his party and said he paid taxes on all income.
"Nothing related to this matter has prevented me, nor will it prevent me from governing," the prime minister told parliament, which opened with one minute of silence for the 79 people killed in a July 21 train derailment near Santiago de Compostela in northwestern Spain.
Rajoy, who took power after leading his party to a landslide election win in November 2011, said ledgers published in the press supposedly showing slush fund payments to him and other party members were "an astonishing and imaginary collection of falsehoods".
The affair threatens to destabilize his government which is battling to strengthen the public finances of the eurozone's fourth-biggest economy, anxiously watched by its neighbours.
The opposition Socialists reiterated their call for Rajoy to step down, insisting that the party slush fund allegations were accurate.
"Mr. Rajoy, you did not tell the truth to the Spanish people. You did not tell the truth when you said that it was all false," Socialist Party leader Alfredo Perez Rubalcaba said.
"You are doing damage to Spain. For that, I ask you to go. I ask for an act of solidarity with a country that cannot suffer for having at its head a prime minister like you."
Rajoy's appearance followed months of damaging leaks in the press and pressure from political opponents who threatened a no-confidence vote.
The corruption affair originated in 2009 as a judicial investigation into alleged kickbacks involving members of the Popular Party and construction companies.
It exploded in January when leading daily El Pais published copies of account ledgers purportedly showing the irregular payments to top party members, including Rajoy who has led the party since 2004.
Those allegations sparked outrage among ordinary Spaniards struggling with spending cuts that Rajoy has imposed during a deep recession.
Barcenas was jailed last month pending an investigation into a separate corruption case, in which he is alleged to have held secret Swiss bank accounts.
On July 14 centre-right daily newspaper El Mundo published friendly mobile telephone text messages sent by Rajoy to Barcenas from May 2011 to March 2013, some two months after the scandal erupted.
The noose appeared to tighten around the premier when Barcenas testified in court that he handed cash to Rajoy and the party's deputy leader Maria Dolores de Cospedal.
Conservative newspaper El Mundo calculated that Barcenas paid a total of €343,700($456,260) to Rajoy over two decades.
Cospedal has been summoned to testify as a witness on August 14 by the judge investigating the scandal, Pablo Ruz. She, too, has rejected Barcenas's claims as lies.
In a poll published on July 21 in El Mundo, nearly nine out of 10 Spaniards questioned said they felt Rajoy should explain himself in parliament.
Two-thirds believed Rajoy had received payments, with one in five believing the contrary.
Political analysts say it is unlikely Rajoy will step down, however. Such resignations have been very rare in Spanish politics since the restoration of democracy in 1978.