Greece's PM George Papandreou has won a crucial confidence vote after promising to hold power-sharing talks.
In an address to parliament before the vote he ruled out snap elections, saying they would be "catastrophic".
He said he did not care about his post and the leadership of any government of national unity would be negotiable.
Mr Papandreou previously shocked EU partners and sent markets into turmoil after calling for a referendum on an EU deal to bail out debt-ridden Greece.
Mr Papandreou said the bail-out deal currently on offer by the EU had to be accepted, and it would be "historically irresponsible" to lose it.
He said immediate elections would be "catastrophic" for the deal, so proposed a new coalition to take charge until it had been agreed.
"I have been in contact with the president and I will visit him tomorrow (Saturday) to inform him of my intentions and that I am moving forward with all the parties for a broader coalition government, and to agree on common goals, a timeframe and people, to agree on its composition and even the head of this coalition," he said.
"I therefore ask for a vote of confidence in order to ensure the security of this nation."
The vote took place after several hours' debate. Mr Papandreou addressed parliament for more than half an hour.
Thousands of protesters have gathered in Athens' Syntagma Square. Security has been tightened around the nearby parliament building.
Eurozone leaders fear that failure to solve the Greek debt crisis could risk it spreading to other vulnerable economies, particularly Italy.
The figures in the Greek parliament revealed Mr Papandreou's vulnerability. His governing Socialist party (Pasok) held a tiny majority - 152 out of 300 seats. In the end 153 MPs voted for the government.
The vote was timed to take place when the markets in Europe and the US are closed, such is the sensitivity of the issue.
Although Mr Papandreou survived the confidence vote, the political situation in Greece still seemed far from certain.
Leader of the main opposition New Democracy party Antonis Samaras rejected the prime minister's idea of a coalition government and repeated his demands for immediate elections.
"Mr Papandreou rejected our proposal. The only solution is elections," a party spokesman quoted Mr Samaras as saying.
On Thursday Mr Samaras led his MPs in a dramatic walkout of parliament.
The proposed referendum had caused serious divisions in Pasok, with Finance Minister Evangelos Venizelos insisting it should not be held.
He told European partners on Friday that Greece had officially scrapped the referendum.
Mr Venizelos said he had informed EU Economic and Monetary Affairs Commissioner Olli Rehn, German Finance Minister Wolfgang Schaeuble and eurozone chairman Jean-Claude Juncker of the decision.
Mr Papandreou had earlier said the referendum was never an end in itself, and there were two other choices - an election, which he said would bankrupt the country, or a consensus in parliament.
Earlier on Friday, European Commission President Jose Manuel Barroso told the BBC he expected a government of national unity to be formed in Greece and that the economic problems "will be solved".
In another development on Friday, international ratings agency Moody's cut Cyprus's credit grade by two notches - to the brink of junk status - over its banking sector's exposure to Greek bonds.
The Greek crisis overshadowed the G20 summit in Cannes which ended on Friday.
EU President Herman Van Rompuy said leaders had agreed to increase the firepower of the International Monetary Fund (IMF), but gave no specifics on the funding.
Mr Papandreou had been summoned for urgent talks at the G20 on Wednesday, where he was told that any referendum would turn on the question of whether Greece wanted to stay in the eurozone.
The next tranche of Greece's existing bailout was also put on hold.
Without the bailout funds, Greece may go bankrupt before the end of the year.
The EU bailout deal, agreed last month, would give the heavily indebted Greek government 130bn euros (£111bn; $178bn) and it imposes a 50% write-off on private holders of Greek debts, in return for deeply unpopular austerity measures.
Although the Greek public has strongly resisted the austerity measures, a recent opinion poll in a newspaper showed 70% wanted to remain within the eurozone.