Greece's prime minister survived a key confidence vote, keeping alive a government bid to avert a debt default that could spark a financial maelstrom around the world.

MPs voted 155 to 143 along party lines last night to back George Papandreou, who now faces a critical vote next week on a massive austerity package that Greece's international creditors have said must pass by the end of June.

He is seeking 28 billion euro (£24.8bn) in budget cuts and new taxes and 50 billion euro (£44.3bn) worth of privatisation of public assets. Unless the new measures pass, Greece will not receive the next batch of bailout funds worth 12 billion euro (£10.6bn), and will face a disastrous default in July, when it runs out of money.

A default by Greece could drag down Greek and European banks and renew fears over the finances of other eurozone countries such as Portugal, Ireland and Spain.

Mr Papandreou must still convince all the MPs from his Socialist party to support the austerity bill, which has provoked strikes, riots and a slump in his popularity.

While all 155 Socialists voted in favour of the confidence motion, several have publicly criticised the austerity measures and at least one has said he will not back them.

After the vote, riot police fired tear gas and stun grenades to push back a group of about 200 protesters who had broken off from a main rally of several thousand to throw bottles and other objects at the police lines guarding the Athens parliament.

"We will do everything in our power to end the state of insecurity Greek families face and exit this crisis in a safe way. We have a plan, we have prospects," Mr Papandreou said during a debate before his victory.

"Regardless of the panic caused by some, we are on an organised course, helped by the international community with massive loans - the largest every given in the history of our planet."

Mr Papandreou's government came to the brink of collapse last week as protesters rioted on the streets of Athens, two party rebels resigned their parliamentary seats and talks with the opposition conservatives over forming a pro-austerity coalition government fell apart.

In response, he reshuffled his Cabinet, replaced his increasingly unpopular finance minister with a party heavyweight - his main internal rival - and called for the confidence vote.

European officials have been pressing opposition leader Antonis Samaras to back the austerity bill, which will run to 2015, two years beyond the current government's mandate. But Mr Samaras has insisted the thinking behind it is wrong, saying it is keeping Greece in a recession. He has called for a renegotiation of the initial bailout deal.

Mr Papandreou's losing the confidence vote would have probably led to early elections and thrown into question whether Greece could pass the new austerity measures. Expectations he would win lifted world markets earlier in the day.

As deputies voted, several thousand protesters gathered outside parliament chanting "Thieves! thieves!", shining green laser lights at the parliament building and into the eyes of riot police. Continuing strikes by electricity company workers objecting to privatisation caused a second day of rolling power cuts.

"I understand the anger, the fear, and the question whether we will make it," Mr Papandreou said. "My answer is that we have been making it every day for the last 20 months, with difficulties and mistakes, with a price to pay and with sacrifices but we are succeeding."

Greece is being kept afloat by a 110 billion euro (£97.5bn) package of bailout loans granted by other eurozone countries and the International Monetary Fund last year, and has implemented strict austerity measures in return, cutting public sector salaries and pensions, increasing taxes and overhauling its welfare system.

But the country has struggled to meet it targets, missing many, and is now in negotiations for a second bailout, which Mr Papandreou has said will be roughly the same size as the first.

Officials from the IMF, European Commission and European Central Bank who have been overseeing Greece's reforms were in Athens today to discuss the new austerity measures.

Yesterday the new finance minister, Evangelos Venizelos, promised that parliament would pass the unpopular austerity package by the end of June.

"We must follow this course to save the country," he said.

"Our European partners ... face us with distrust. This is an atmosphere that we have to change."

Mr Papandreou's popularity has been hammered by the latest austerity measures, with an opinion poll published yesterday giving the Socialists a 20.1% approval rating. Rival conservatives fared marginally better, at 21%, in the GPO survey for private Mega television of 1,000 adults.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.