ATHENS, Greece — Greece fended off a bankruptcy that threatened to roil global financial markets, approving severe spending cuts and tax increases Wednesday in the face of violent protests by Greeks who say they have suffered enough.
The package of austerity measures would keep bailout money flowing to Greece from other European countries and the International Monetary Fund. It would free $17 billion in fresh loans, although the money will only be enough to see the nation through September.
Investors around the world cheered the news, but protesters, fighting tear gas, hurled whatever they could find at riot police and tried to blockade the Parliament building.
"This is bad. The country will be sold for a piece of bread," said insurer Dimitris Kostopoulos. "There were many other more appropriate alternatives to this. Parliament has once again betrayed us."
Public sector salaries and pensions have been cut in the past year, and unemployment is above 16 percent. By comparison, it is about 9 percent in the United States.
Parliament approved $40 billion in tax increases and spending cuts, and privatization of public services to raise $71 billion more, all through 2015. Greece's overall economic output is about $330 billion, or roughly the size of Washington state's.
The $17 billion in loans are the latest batch in a $157 billion bailout by the European Union and the IMF. Parliament is expected to pass another bill Thursday to implement the austerity measures.
Without the bailout money, Greece was at risk of default. While no one knows for sure what would have happened next, analysts have said it would have threatened the viability of the euro, the European Union's common currency, and could have done much worse.
Some market experts had predicted a Greek default could have trigged another world financial meltdown, like what happened after the Lehman Brothers investment house collapsed in 2008 in the United States.
The risk is that banks, both in Europe and the U.S., would have had to chalk up billions of dollars in losses because of Greek loans that had gone bad. No one knows which U.S. banks hold what amount of Greek debt.
On Sunday, European finance ministers will meet in Brussels to work on a second bailout for Greece, expected to be similar in size to the first, in hopes of shoring up its finances beyond just a few months.
Banks are expected to share some of the burden. One way would be for banks to repurchase Greek bonds after they expire, as French banks have indicated they may do. Many economists still expect it won't be enough.
"We must avoid the country's collapse with every effort," Prime Minister George Papandreou said before the vote. "Outside, many are protesting. Some are truly suffering. Others are losing their privileges. It is their democratic right. But they and no one else must never suffer the consequences ... of a collapse."
More protests could undermine the government's ability to implement the harsh austerity measures, which tax even the lowest-paid Greeks and raise prices during a recession.
"They are not out of the water just yet," said Carl Campus, an analyst at BMO Capital Markets.
The cuts and tax increases passed 155-138, with five voting "present" and backing neither side. During the vote, stun grenades echoed across a square outside Parliament. Acrid clouds of tear gas and orange and green smoke-bomb mist hung in the air.
Several banks and storefronts were smashed, while a Socialist dissenter who backed the government at the last minute, Alexandros Athanassiadis, was briefly assaulted by protesters after leaving Parliament on foot.
Violence continued throughout the afternoon, and smoke billowed from a post office beneath the finance ministry before a fire was put out. Rioters set up burning barricades along Syntagma Square, where demonstrators have staged a sit-in for the past month. Nearby streets were littered with chunks of smashed marble and ripped-up paving stones that had been thrown at police.
A general strike that began Tuesday paralyzed the country, grounding planes, leaving ferries docked and stranding tourists during the busy summer season.
By Wednesday night, police said 49 officers had been injured, one seriously when he was hit in the face by a chunk of marble. Forty-three protesters were detained, with 17 of them arrested. Emergency services said they had treated 99 protesters and passers-by for injuries.
Dozens of injured were treated at a first-aid center set up inside the square's metro station. Most were treated for breathing problems, contusions and broken bones, volunteers at the first aid center said, appealing for medical supplies.
Across Europe, officials hailed the vote as an act of "national responsibility" and urged Greek lawmakers to follow up with another positive vote Thursday.
"That's really good news," German Chancellor Angela Merkel said on her way out of an economic forum in Berlin. Germany is Greece's biggest creditor.
Relief was the main response in markets, too. Soon after the vote, the euro rose against other world currencies, including to $1.44 against the American dollar. Stock markets around the world were posting big gains.
Christopher Torchia, Menelaos Hadjicostis and Demetris Nellas in Athens and Geir Moulson in Berlin contributed.