Greece has taken a crucial step towards a bailout after its parliament passed a second set of reforms.
The passage of the measures means that negotiations on an €86bn European Union bailout can begin.
The reforms include changes to Greek banking and an overhaul of the judiciary system.
Thousands demonstrated outside of parliament as the bill was debated, with protests briefly turning violent as petrol bombs were thrown at police.
There had been fears of a rebellion by MPs but Greek Prime Minister Alexis Tsipras was easily able to muster the support required. In total, the measures received 230 votes in favour and 63 against with five abstentions.
The debate ended at 04:00 local time (01:00 GMT).
Among those who voted against were 31 members of his own Syriza party. However, this represents a smaller rebellion than in last week’s initial vote.
Former Greek Finance Minister Yanis Varoufakis was one of those rebels in the first vote who returned to vote with the government this time.
Mr Varoufakis wrote (in Greek) that he felt it was important to preserve the unity of the government, even if he believed the programme was “designed to fail” by Greece’s creditors.
Speaking before the vote, Mr Tsipras stressed that he was not happy with the measures that creditors had imposed.
“We chose a difficult compromise to avert the most extreme plans by the most extreme circles in Europe,” he told MPs.
Representatives of the European institutions that would provide the bailout funds will begin negotiations in Athens on Friday.
Analysis: BBC Europe correspondent Chris Morris
After another long debate, and plenty of angry exchanges, parliament approved the new reforms in the early hours of the morning.
More than 30 MPs from the governing coalition voted against the measures – but crucially for Alexis Tsipras the number of rebels was slightly lower than last week.
Mr Tsipras was defiant telling parliament that he didn’t really approve of the deal that had been imposed upon him by the rest of the eurozone. But he stressed that it was the only way to keep Greece in the single currency.
Negotiations will now begin on approving the terms of a third bailout, with the aim of completing a deal by the middle of next month. It’s a tight timetable with scepticism on both sides.
And Mr Tsipras still has to decide whether a successful conclusion of negotiations should be followed by early elections.
Last week, Greece passed an initial set of austerity measures imposed by its creditors. These were a mix of economic reforms and budget cuts demanded by the eurozone countries and institutions before bailout talks could continue.
This second set of measures passed early on Thursday morning were of a more structural nature, including:
- a code of civil protection aimed at speeding up court cases
- the adoption of an EU directive to bolster banks and protect savers’ deposits of less than €100,000
- the introduction of rules that would see bank shareholders and creditors – not taxpayers – cover costs of a failed bank
More contentious measures – phasing out early retirement and tax rises for farmers – have been pushed back to August.
On Wednesday, the European Central Bank (ECB) increased its cash lifeline to Greek banks.
The emergency injection of an extra €900m (£630m), the ECB’s second in a week, came just hours before the vote.
The International Monetary Fund (IMF) confirmed on Monday that Greece had cleared its overdue debt repayments of €2.05bn and was no longer in arrears.
The repayments, which included €4.2bn to the ECB, were made possible by a short-term EU loan of €7.16bn.
Greece’s next major deadline is 20 August, when it must pay €3.2bn owed to the ECB, followed by a payment of €1.5bn to the IMF in September.
The protest in Athens’ Syntagma Square – called by Greece’s public sector union – was reported to have been largely peaceful, until a number of petrol bombs were thrown in the direction of police.
The BBC’s Piers Scholfield tweeted from the scene that a small number of anarchists – no more than a few dozen – attempted to create a disturbance but the situation soon calmed down.