It went through by 169 votes to 168, with one deputy from the opposition Popular Party (PP), which was against the bill, brought to the session by ambulance to ensure he could participate, reports Reuters.
In a heated debate, PP leader Mariano Rajoy criticized prime minister Jose Luis Rodriguez Zapatero and said: "This law is improvised, insufficient and unjust."
The austerity package includes a five per cent pay cut for civil servants, a freeze on pensions and reductions in public investment spending.
It was only passed after ten members of the CiU party, which was also against it, decided to abstain from the vote after stating they did not want to see Spain follow Greece into economic meltdown, which they feared a rejection of the bill may lead to.
Earlier this week, an International Monetary Fund report warned that Spain has to reform its economy, due to factors such as a large fiscal deficit and "anaemic productivity growth".
By Claire Archer