Thousands of protesters hurled stones and Molotov cocktails at police yesterday, as Greek police reportedly began to run out of teargas after a week of riots that have seen the streets of major cities turned into virtual war zones. Police sources say they have used more than 4,600 teargas capsules in the past week and have contacted Israel and Germany for fresh stocks. The prime minister, Costas Karamanlis, yesterday vowed to keep citizens safe, but students angry at the fatal shooting of 15-year-old Alexandros Grigoropoulos by the police again attacked officers outside parliament.

"Alexi, these nights are yours," says the graffiti on the subway wall, addressed to the Athens schoolboy killed last Saturday, allegedly by a police bullet. The week of rioting and protest that has left the city in shards belongs, above all, to the young. It is a revolt of schoolchildren and students, most on the streets for the first time. There are reports of children as young as 12 battling riot police, shouting "Cops! Pigs! Murderers!"

The teenagers and twenty-somethings who have come close to toppling the Greek government are not the marginalised: this is no replay of the riots that convulsed Paris in 2005. Many are sons and daughters of the middle classes, shocked at the killing of one of their own, disgusted with the government's incompetence and corruption, enraged by the broken promises of the education system, scared at the prospect of having to work still harder than their exhausted parents.

Some call themselves the "€700 generation" in recognition of the wage they expect their degrees to get them. The intensity of their fury has startled the whole country - including, perhaps, themselves.

Anarchist groups dreaming of revolution played a key part in the first waves of destruction, but this week's protests were not orchestrated by the usual suspects, who relish a good bust-up and a whiff of teargas. There's been no siege of the American embassy, no blaming Bush, very few party slogans.

Though the spectacular violence has dominated the news, thousands have also set out to join in peaceful demonstrations, among them parents worried for their children's future. Linked by the internet, by twitter and text messages, many are trying to distance themselves from the destruction, which they attribute to "extremists, idiots and provocateurs".

The demands of the young are hard to formulate. They want an end to police violence; they want to change things; they want jobs, and hope; they want a better system. If the wish list is slightly vague, the problem itself is amorphous and difficult to name: a crisis of values and institutions, society and economy, vision and leadership.

Politically, Greece is a democracy that never grew up; economically, it remains a poor relation trying to pass in the salons of Europe. Its 20th-century history is a patchwork of coups and conflicts. The civil war that followed Greece's occupation by the Axis powers in the second world war put politics on ice for 30 years. Greece is the only European country where collaborators were rewarded and those who resisted were punished. After the left's defeat by Britain and the US, tens of thousands of resistance sympathisers spent years in prison camps or blacklisted from work.

The military dictatorship of 1967-1974 - brought down by the Turkish invasion of Cyprus after a Greek coup - was the last gasp of that repressive era. Under the conservative statesman Constantine Karamanlis (uncle of the present prime minister) democracy was restored, but institutions remained weak; under the socialist prime minister Andreas Papandreou (father of the present leader of the opposition), liberties were extended but corruption also flourished, hand in a hand with a corrosive leftwing populism.

At the same time, the country has been in the throes of a rapid and painful modernisation. In 40 years Greece has gone from peasant agriculture supported by a large diaspora to a mixed economy drawing foreign investment; from the periphery of the developed world to the middle ranks of Europe and the hub of the new Balkans; from a homogeneous nation where the lucky had jobs for life to a multicultural country where a fifth of the workforce are new immigrants.

Many of its most talented sons and daughters have chosen to work abroad rather than deal with Greece's disorganisation and bureaucracy. The social fabric has worn paper-thin. Few politicians have risen to these challenges; most have relied on the old system of trading votes for favours, or on periodic appeals to nationalism and xenophobia.

Costas Karamanlis' New Democracy government - which enjoys a parliamentary majority of one - has surpassed its predecessors in graft and corruption while imposing punitive economic austerity measures. Greece entered the eurozone in 2001 with a large budget deficit; prices have risen consistently since then. In 2004 the country spent an estimated €10bn on the Olympic games, an unknown portion of it pocketed by contractors and politicians.

The two trade union federations that staged a general strike this week want increased social spending in light of the global recession. But the government has called for bigger pension contributions and removed a tax exemption for some of the poorest self-employed. It has also partially privatised ports and plans to do the same with hospitals and schools - at a time when one in five live in poverty and youth unemployment stands near 25%, the highest in Europe.

Meanwhile, the centre of Athens is full of expensive boutiques; shopping malls sprout like mushrooms in the suburbs. Instead of education, values and understanding, the young are being sold an aspirational "lifestyle" they can't afford, which many of them don't want.

They watch their parents struggling to make ends meet and are told to work hard at school only to find that without connections they can't get a job - or a flat, or decent medical care. Despite the rhetoric of meritocracy Greece still runs on "means", up to the highest levels.

In the weeks before the shooting of Alexis, the papers were full of the latest government scandal, a series of lucrative land swaps carried out for Mount Athos's largest monastery, which involved at least three senior aides to the prime minister and are said to have cost the public more than €100m.

Graft, of course, goes hand in hand with incompetence. The government's failure to contain devastating fires of 2007, in which at least 67 people died and 642,000 acres of farmland and forest were destroyed, was partly due to political tinkering with the fire brigades; the lack of progress in restoring burnt-out areas is due partly to pressure from developers eager to cash in.

Given that precedent, no one in Athens is surprised that the riots have got so wildly out of hand. It is the other shoe dropping - or, as one journalist put it, Nero fiddling for a second time while the city goes up in flames.

Is this a country on the verge of a nervous breakdown? For some time, discontent in Greece has been aggressively policed. The area of Athens where the child was shot - a neighbourhood of ungentrified cafes where young people and anarchists, dope-heads and intellectuals all hang out together - has long been the target of a clean-up operation.

Police violence is not new, it is just that previous victims have been immigrants or Roma and so do not make the media. As usual when there is social dislocation, the far right has gained strength: the populist Orthodox Rally won 10 seats in parliament for the first time last year, and the neo-fascist Golden Dawn organisation is known to have supporters inside the police. Now that the lid has blown off the pressure cooker, repression may take more blatant and more violent forms.

More crucially, there is no obvious way out of the impasse. The problems facing Greece are profound and the recession will pull tensions tighter. Greece has a long tradition of protest and resistance - some of those occupying Athens University claim descent from the students who fell before the junta's tanks in 1973 - but less experience of concerted action to find solutions.

After the violence dies down there will, sooner or later, have to be an election. But the problems the young have exposed have been decades in the making. No one has begun to imagine a solution.

· This article was amended on Tuesday 16 December 2008. The byline on the article above mistakenly placed the writer Maria Margaronis in Athens. She was writing from London. This has been corrected.