The eurozone's fourth largest economy shrank by 1.4 percent year-on-year in 2012 as households slashed spending, the national statistics institute said.
That was a slightly better performance than the decline of 1.5 percent forecast by the government.
But gross domestic product contracted 0.8 percent in the final quarter of 2012, the steepest decline since the second quarter of 2009 and more than double the 0.3 percent fall posted in the previous three-month period.
The figures were slightly bleaker than preliminary data released last month by the statistics institute which saw the economy falling by 0.7 percent in the final quarter on a quarterly basis and by 1.37 percent for the entire year.
Spain is grappling with a double-dip recession and 26 percent unemployment, prompted by the collapse of a decade-long property boom in 2008.
Prime Minister Mariano Rajoy's conservative government forecasts the economy will return to growth in the second half of 2013.
It predicts an economic contraction of 0.5 percent in 2013 followed by an expansion of 1.2 percent in 2014, a more optimistic forecast than those of most analysts and international organisations.
Activity appeared to be cramped by spending cuts and tax rises, aimed at saving €150 billion ($194 billion) between 2012 and 2014, which have prompted mass street protests.
The economic contraction in the fourth quarter was caused mainly by a fall in domestic demand, the national statistics institute said.
Consumer spending fell 1.9 percent while government expenditure dropped 0.3 percent.
The government has vowed to lower the public deficit from the equivalent of 9.4 percent of gross domestic product last year to 2.8 percent in 2014.
Analysts say those targets will be hard to reach in a period of declining economic activity.
But Budget Minister Cristobal Montoro said Spain does not need new measures to rein in its spending shortfall in 2013 even though the country slightly missed its targets for the shortfall last year.
"There is no need for new cutbacks," he told a news conference.
Spain's overall public deficit reached 6.74 percent of GDP in 2012, compared with a target agreed with the European Commission of 6.3 percent, he said.
The public deficit of Spain's 17 powerful autonomous regions stood at 1.73 percent of GDP last year, compared to the target of 1.5 percent.
"I insist that what we achieved is really big, important, really notable and it will help Spain and its regional governments recover their credibility," Montoro said.
Other official data released Thursday offered signs of economic strengthening.
Spain's inflation rate remained unchanged at 2.8 percent in February compared to January after declining from October, the national statistics institute said in a separate report.
The country's current account deficit meanwhile plunged by 78 percent in 2012 to €8.3 billion from €37.5 billion in the previous year as rising exports helped slash its trade balance, the Bank of Spain said.
It was the third consecutive yearly fall in the current account deficit following declines of 17.8 percent in 2011 and of 18.2 percent in 2010.
Spain ran up the world's second-biggest current account deficit during the housing boom up to 2008.
In December Spain posted a current account surplus of €4.9 billion, compared with a current account deficit of €3.9 billion during the same period a year earlier.