Anarchist rioters clashed with police for over three hours on Thursday, hurling petrol bombs and smashing banks and stores while rampaging through central Athens.

At least 20 people were hurt and 40 detained after the violence erupted outside parliament, during a rally attended by more than 20,000 students and academic staff against education reforms.

Police responded with massive use of tear gas, in the worst violence since students began protests which have kept most Greek universities closed for up to 10 weeks.

The clashes broke out as Parliament debated legislation to increase the autonomy of state-run universities, and relax a ban on police entering campus grounds. The reforms were approved shortly afterward.

Hundreds of youths, wearing hoods and helmets, broke away from the rally to confront police. They threw flares and petrol bombs at police, after smashing storefronts and firebombing two banks. Windows in the parliament building were also smashed.

The violence disrupted a visit to Athens by Michel Platini, head of Europe's governing body for soccer, UEFA, who is staying at a downtown hotel.

Tourists in front of parliament to watch traditionally dressed presidential guards scrambled to avoid the rioting youths, who dug up paving stones and seized chairs from coffee shops in the city's main Syntagma Square to throw at police.

More than 1,000 riot police had been deployed around the city center for the rally.

"I've never seen anything like it, so many petrol bombs," said one riot policeman, who asked not to be identified. "Five of my colleagues are hurt. We've seized flare guns and wooden bats from the rioters."

Rioters also set fire to a guard post in front of the Tomb of the Unknown Soldier, below parliament's main entrance, forcing the monument's ceremonial guard to flee.

Syntagma Square was left strewn with rocks, bottles and wooden bats.

Protest organizers and participants condemned the clashes.

"These people who throw stones are discrediting the student movement, and playing into the hands of those who are trying to oppress it," said Costas Papadopoulos, a primary school teacher at the rally.

Greece's conservative government has promised to overhaul the higher education system, and change the constitution to allow private universities from next year. Students have responded with near daily public rallies and occupations at more than 250 university buildings, most since the start of the year.

"Building occupations are the last resort ... Everyone's affected by this. It's for our education," said Vassilis Papageorgas, a 20-year-old psychology student who has been on strike since December. "Some students might miss a semester or even the year, but it's a sacrifice that students have chosen to make."

Gregory Tsaltas, a professor of international law at Athens' Panteion University, conceded that students had "no other way to react but to stage occupations."

"(But universities) have been at a complete standstill for two months," he added.