Greece\'s parliament has passed a controversial package of austerity measures, demanded by the eurozone and IMF in return for a 130bn-euro ($170bn; £110bn) bailout to avoid default. The vote came amid some of the worst violence seen in Greece in years. Protesters outside parliament threw stones and petrol bombs, and police fired tear gas. Several people were injured and buildings were set on fire. PM Lucas Papademos urged calm, saying violence had no place in a democracy. Lawmakers have also approved a related deal to write off 100bn euros of Greek debt held by private banks. Despite a rebellion by some MPs from parties in the ruling coalition, the result was expected, reports the BBC\'s Mark Lowen in Athens. Pasok, the largest party, and its coalition ally New Democracy - which have both backed the bill - account for more than 230 deputies out of a total of 300. \'Vandalism\' Running battles with police were still continuing in parts of the capital late on Sunday. Dozens of police officers and at least 37 protesters were injured, 23 suspected rioters were arrested and a further 25 detained, AP reports. What went wrong in Greece? An old drachma note and a euro note Greece\'s economic reforms, which led to it abandoning the drachma as its currency in favour of the euro in 2002, made it easier for the country to borrow money. The opening ceremony at the Athens Olympics Greece went on a big, debt-funded spending spree, including paying for high-profile projects such as the 2004 Athens Olympics, which went well over its budget. A defunct restaurant for sale in central Athens The country was hit by the downturn, which meant it had to spend more on benefits and received less in taxes. There were also doubts about the accuracy of its economic statistics. A man with a bag of coins walks past the headquarters of the Bank of Greece Greece\'s economic problems meant lenders started charging higher interest rates to lend it money. Widespread tax evasion also hit the government\'s coffers. Workers in a rally led by the PAME union in Athens on 22 April 2010 There have been demonstrations against the government\'s austerity measures to deal with its debt, such as cuts to public sector pay and pensions, reduced benefits and increased taxes. Greek Prime Minister George Papandreou at an EU summit in Brussels on 26 March 2010 The EU, IMF and European Central Bank agreed 229bn euros ($300bn; £190bn) of rescue loans for Greece. Prime Minister George Papandreou quit in November 2011 after trying to call a referendum. Greece\'s problems have made investors nervous, which has made it more expensive for other European countries such as Portugal to borrow money. Eurozone leaders are worried that if Greece were to default, and even leave the euro, it would cause a major financial crisis that could spread to much bigger economies such as Italy and Spain. Lucas Papademos Under Prime Minister Lucas Papademos, Greece is trying to negotiate a big write-off of private debts and secure a second bail-out of 130bn euros ($170bn, £80bn) before a 20 March deadline. BACK 1 of 8 NEXT Protesters hurled flares and chunks of marble torn up from the square. Some had tried to break through a cordon of riot police around the parliament. Several historic buildings, including cafes and cinemas, were in flames. Syntagma Square - in the heart of Athens - is cloaked in a hail of tear gas, our correspondent adds. Ioannis Simantiras, 34, said the protesters were boxed in by the police. \"Nobody could get away from the gas,\" he told the BBC. \"When it engulfed everybody, and everybody was choking the police drew back and opened up a corridor for us away from the parliament - that\'s when everybody made a run for it.\" Mr Papademos had earlier said Greece did not have the luxury of such protests in such difficult times. \"Vandalisms, violence and destruction have no place in a democratic country and won\'t be tolerated,\" he said in a speech in parliament before the vote.