Greece’s parliament has backed draft terms for a third bailout in five years after talks that lasted through the night and well into the morning.
The proposed deal involves tax rises and spending cuts in return for a bailout of about €85bn (£61bn, $95bn).
Prime Minister Alexis Tsipras also survived a significant rebellion within his own Syriza party.
Reports in Greece say he will ask for a confidence vote before parliament in the next week.
Makis Voridis, an MP with the opposition New Democracy, said his party – which backed the bailout deal – would not support Mr Tsipras in a confidence vote, Reuters news agency reported.
The bailout deal received:
- 222 votes for
- 64 against
- 11 abstentions
But there were 31 “No” votes from Syriza members, and 11 abstentions – the biggest rebellion within Mr Tsipras’ party so far. The rebels represented almost a third of all Syriza’s MPs.
The terms of the bailout will be discussed by eurozone finance ministers later on Friday.
The debate itself was preceded by hours of often angry exchanges in parliament.
Voting started just after 09:30 local time (06:30 GMT), more than six hours after the main debate began. The debate itself had been delayed by procedural issues.
Members of parliament had to agree on the terms so that eurozone ministers could endorse the draft deal.
Greece faces an urgent deadline on 20 August, when it must repay about €3.2bn to the European Central Bank (ECB).
If Greece had failed to agree on new terms for a bailout, the ECB is likely to have stopped giving emergency funds to Greek banks.
Third Greece bailout: What are eurozone conditions?
One of Mr Tsipras’ most vocal critics within his own party was his former ally, parliamentary speaker Zoe Konstantopoulou.
She said she could not support the deal, and faced calls from Mr Tsipras to hurry her handling of the bill. Instead, she took time to raise several concerns, delaying the timing of the debate – to the prime minister’s visible frustration.
Another Syriza MP, Panagiotis Lafazanis, told Mr Tsipras: “I feel ashamed for you. We no longer have a democracy, but a eurozone dictatorship.”
Mr Tsipras told MPs they were facing a choice between “staying alive or suicide”, adding: “I have my conscience clear that it is the best we could achieve under the current balance of power in Europe, under conditions of economic and financial asphyxiation imposed upon us.”
Rebels have insisted the government should make good on its electoral promise to reverse spending cuts and tax rises.
In two prior votes on bailout reforms, they had refused to approve tax increases, pension cuts and market reforms.
Analysis: Paul Adams, BBC diplomatic correspondent, Athens
After more than seven hours of often passionate, bad-tempered debate, all through the night, the Greek Prime Minister, Alexis Tsipras, has got his way. The bailout bill has passed by a comfortable majority.
Towards the end of the debate, Mr Tsipras defended what he called a painful but responsible decision. He said the country had no choice. This was not a triumph, he said, but nor was Greece in mourning.
The bill may have passed, but Mr Tsipras has paid a heavy political price. Almost a third of his own Syriza party members voted against the bailout, even more than expected. They believe the prime minister has comprehensively betrayed election pledges to turn his back on austerity.
In theory, Mr Tsipras has lost his parliamentary majority and his government is hanging by a thread. It’s being widely reported he’ll seek a vote of confidence next week, bringing the prospect of snap elections in the autumn that much closer.
But for now, the scene is set for eurozone finance ministers, meeting in Brussels later in the day, to give the bailout their seal of approval.