Athens erupted in violent riots Wednesday after Greek legislators approved a key austerity bill necessary for a vital financial bailout.

That bailout from the European Union and International Monetary Fund will effectively save Greece from defaulting on its debts when they come due next month.

Both the EU and IMF have demanded Greece commit to cut spending and raise taxes by euro28 billion (US$40 billion) over five years, and raise another euro50 billion (US$71 billion) in privatizations in the same period, as a trade-off for the bailout.

The unpopular package of spending cuts passed 155 votes to 138, paving the way for a euro12 billion installment of the country's euro110 billion (US$157 billion) bailout fund.

And while Europe may have breathed a sigh of relief at the passage of the bill -- which many believe could stave off a continent-wide banking crisis -- protests outside the parliament raged as police launched stun grenades and tear gas canisters while crowds of young men threw rocks and debris and set fires in the streets.

Patrick Leblond, an international affairs expert from the University of Ottawa, said the protests may be destructive, but the cuts are necessary.

"No one likes austerity, no one likes to lose their jobs, no one likes recessions, but the fact is, Greece -- and the Greeks -- have been living beyond their means for a decade," he said.

"At some point, you have to live within your means."

Many Greeks have already felt the consequences of the nation's worst recession in four decades, and further cuts will only exacerbate matters for many, who have seen their standard of living fall over the past months.

"This is bad, the country will be sold for a piece of bread," said protestor Dimitris Kostopoulos, a 48-year-old insurer. "There were many other more appropriate alternatives to this. Parliament has once again betrayed us."

Pensions and salaries have already been cut, and unemployment now sits at 16 per cent nationally.

According to Leblond, if Greece had defaulted on its debt, it could have created economic shockwaves throughout the European Union.

"At least it keeps Greece on its feet for now, but this is a long-term plan," he said.

Earlier, the violence began before the vote, with demonstrations taking place in the main square.

"There were both some very ugly scenes before and after the vote and according to police there are about 500 rioters roaming the centre of Athens, engaged in running battles with police," said Nick Malkoutzis of the Kathimerini English Edition newspaper.

He added: "This is the worst violence in central Athens in about a year."

Riot police would occasionally charge into the crowd in an attempt to disperse crowds, but would quickly pull back.

Protesters threw flares and smoke bombs, and some sprayed fire extinguishers at police. Officers, in turn, picked up rocks thrown by demonstrators and threw them back at the crowd.

Malkoutzis told CTV News Channel the violence was being perpetrated by a minority of the demonstrators. The majority of protesters, he said, have carried out peaceful protests on a daily basis for weeks leading up to Wednesday's vote.

"It's kind of destroyed the peaceful mood of the other thousands of protesters who had gathered to voice their opposition to these very tough austerity measures," he said of the violence.

Police in the core of Athens have taken strong criticism in recent days for their response to the protests, Malkoutzis said.

At least 38 police officers have been injured, including one who sustained serious injuries when he was hit in the face with a chunk of marble hurled by a demonstrator.

So far, 30 protesters have been detained, with 11 arrested. Police said 99 people have been injured.

A general strike has crippled the country's transportation system since Tuesday, keeping ferries docked, planes grounded and trains stopped during the summer tourism season.

With files from The Associated Press