Refusal to approve the package would have been a blow to Prime Minister Zapatero
The Spanish parliament has backed a 15bn-euro ($18.4bn; £13bn) austerity package by one vote as the country strives to cut its budget deficit.
The vote saw 169 in favour of the Socialist government's austerity plan and 168 against, with 13 abstentions.
Spain announced the austerity package earlier this month. It includes wage cuts of 5% or more for civil servants and slashes public investment plans.
Spain hopes to rein in its deficit and ease fears of a Greek-style crisis.
A parliamentary defeat would have been a blow to the Socialist government of Prime Minister Jose Luis Rodriguez Zapatero.
Spain's programme is intended to reduce a deficit of 11% of GDP to 6% by 2011.
‘Painful but inevitable’
Many Spaniards fear the effect the cuts will have on the economy, where the unemployment rate exceeds 20% – twice the eurozone average.
SPANISH COST-CUTTING PLANContinue reading the main story5% average pay cut for public workers in 2010Payout scrapped to parents for birth of childrenAutomatic inflation-adjustments for pensions suspendedFunding to regions cut by 1.2bn euros
The country moved out of recession in the first quarter of this year, with growth of 0.1%.
The European Union has been anxious to see more fragile European economies, including Spain, Portugal and Greece, impose tougher austerity measures.
Before the vote, finance minister Elena Salgado had asked politicians to vote in favour, saying the measures were "painful but inevitable".
This article is from the BBC News website. © British Broadcasting Corporation, The BBC is not responsible for the content of external internet sites.