A majority of Greek MPs have backed tough economic measures required to enable an €86 billion eurozone bailout deal to go ahead.
The new legislation includes tax rises and an increase in the retirement age.
As debate continued beyond a 10pm GMT deadline (10am NZST) ahead of the vote, protesters threw petrol bombs at police during an anti-austerity protest close to parliament.
Police responded with tear gas, sending hundreds of people fleeing in central Syntagma Square.
Greek Prime Minister Alexis Tsipras said he did not believe in the deal, but urged MPs to agree to the measures.
In a passionate speech just before the vote, he told parliament: "The Greek people are fully conscious and can understand the difference between those who fight in an unfair battle and those who just hand in their weapons."
The vote passed with opposition help despite a revolt from some hardliners in the ruling left-wing Syriza party.
The final count was 229 votes in favour from the 300-seat chamber but 38 Syriza lawmakers either abstained or voted against the government.
Thousands of people took to the streets of Athens in a series of peaceful marches earlier in the day to protest against the bailout deal and any further austerity reforms.
Pharmacists pulled down their shutters across Greece and civil servants walked off their jobs in a 24-hour strike.
More than half of the members of Syriza's central committee have signed a statement condemning the bailout agreement, describing it as a coup against their nation by European leaders.
The possible bailout was agreed in Brussels on Monday by eurozone members, though one of Greece's creditors, the International Monetary Fund, suggested in a report that it did not go far enough - and that Greece would need some of its debts written off.
Greece's economy has shrunk by 25 percent in the last five years amid austerity measures designed to curtail its ballooning public sector debt.
In order to begin negotiations over a third bailout worth €86 billion over three years, Greek MPs were required to approve measures including:
The announcement earlier this week of the possible deal was met with anger among many in Greece, who called it a "humiliation".
- BBC