Rajoy used the annual state of the nation debate to credit the belt-tightening measures put in place by his conservative government since December 2011 with bringing down Spain's borrowing costs, avoiding a bailout and reviving the economy.
"We have achieved what many believed was impossible," Rajoy said.
"It is not with demagoguery that we can maintain the welfare state," he added, alluding to the anti-establishment Podemos, a close ally of Greece's governing Syriza party, which is leading polls ahead of general elections expected later this year.
The Spanish economy grew by 1.4 percent in 2014, the first full year of economic growth since a 2008 property crash which put millions of people out of work and pushed the country to the brink of a bailout.
Rajoy revised his government's growth forecast for this year upwards to 2.4 percent from 2.0 percent and said the country could create over half a million jobs in 2015.
"The greatest social policy of this government was avoiding the bailout,"he said.
Spain did not receive a full bailout like Portugal, Greece and Ireland, but received 41.4 billion euros ($47 billion) from international creditors in 2012 to prevent its banking sector from collapsing.
While the unemployment rate has started to fall, it stood at 23.7 percent at the end of 2014, the second-highest rate in the eurozone after Greece.
It was Rajoy's last state of the nation debate before a string of polls that start in March with a regional vote in Andalucia, Spain's largest region, and culminate in parliamentary elections at the end of the year.
The leader of the main opposition Socialists, Pedro Sanchez, said the prime minister had painted a rosy picture of the economy which did not reflect reality.
"There has never been as much precariousness as today. You have allowed what was a nightmare before the crisis, earning a thousand euros a month, to become an unattainable dream for thousands of Spaniards," he said.
Rajoy's Popular Party and the Socialists have alternately ruled Spain since the country returned to democracy after the death of dictator Francisco Franco in 1975.
But they now face a stiff challenge from Podemos, which was founded just a year ago on a promise to fight corruption and protect public services which suffered huge cuts under Rajoy.
Polls show the party coming first or second in the general election, with over 20 percent support.
Surveys also show that Ciudadanos, a centre-right party which campaigns on a theme of national unity and also rails against corruption and high unemployment, is rapidly gaining ground.
The party, which only ran candidates in the northeastern region of Catalonia during the last general election, is credited with around 7.0 percent support.
Neither Podemos nor Ciudadanos have any seats in parliament at present but are expected to prevent either of Spain's two mainstream parties from obtaining an absolute majority in the next election.
"All polls indicate that the Spanish political system will change in the next general election and they will end bipartisanship," Jose Pablo Ferrandiz, a sociologist who heads the polling firm Metroscopia told AFP.
Andalucia will vote in a regional election on March 22, with local and regional elections in the rest of the country slated for May 22.
No date has yet been set for the general election, which is expected at the end of 2015.
During the parliamentary debate Rajoy announced a series of measures aimed at middle class voters.
Among them was a change in the law allowing people to have their debts wiped in exchange for the seizure of their assets -- a facility that is not widely available at present.