Greek Prime Minister Alexis Tsipras managed to push through a second set of reforms package through parliament, this time more easily than expected, as thousands of people demonstrated outside parliament.

The passage of the second package, which covers changes to the Greek banking system and an overhaul of the judiciary system, effectively means that talks on an €86bn European Union bailout can now commence.

Athens wants the deal hammered out by 20 August, when Greece is due to pay €3.2bn to the European Central Bank, AFP says.

The vote was taken in the early hours of Thursday morning as protests outside the building briefly turned violent with petrol bombs thrown at police, BBC reported.

Despite fears of another round of rebellion by Tsipras's own party, the package received 230 votes in favour against 63 and five abstentions.

“We chose a difficult compromise to avert the most extreme plans by the most extreme circles in Europe.”

- Greek Prime Minister Alexis Tsipras

In a surprise turnaround, former finance minister Yanis Varoufakis who voted against the first package, voted for the second reform proposal, BBC said.

In an appeal to parliament before the voting started, Tsipras said: "We made tough choices and I personally made difficult, responsible choices. Today we must all redefine the possibilities ahead of us given the new circumstances."

"We chose a difficult compromise to avert the most extreme plans by the most extreme circles in Europe," he added, according to Reuters.

The hardline Left Platform lawmakers from the Syriza party, who opposed the first reform package put forward to parliament last week, also rejected Wednesday's proposal and complained about the length of the bill which was more than 900 pages.

The second package, among others includes rules on propping up failed banks, decreed after the 2008 financial crisis and aimed at shielding taxpayers from the risk of having to bail out lenders.

It requires shareholders and creditors to cover the costs of any bank failures, shifting the burden from taxpayers.

The bill also includes the adoption of new rules for the civil justice system to accelerate judicial processes and cut costs.

Very prominently absent however were the pension reforms curbing early retirement and increasing the tax rates paid by farmers from the current 13% to 26-33%.

Government ministers have said that these reforms will be put forward later.

Fresh Greek elections after bailout in place?

The Syriza government has conceded that it may have to return to the ballot box and hold elections in September or October once the bailout package is agreed after Tsipras saw his support falling at the vote last week, said Reuters.

"We might go to elections, when this is needed," government spokeswoman Olga Gerovasili earlier told local radio, saying that this however would not be helpful at the moment as Athens prepares for talks on the new bailout deal.

"We are trying to bring the situation back to some sort of normality," she said, according to Reuters.