Far-right protesters attacked an old courthouse in central Athens Saturday where hundreds of illegal immigrants have lived for months amid piles of fetid rubbish and human waste without electricity, running water or sanitation.

The group of several dozen people hurled rocks and firecrackers at the eight-story building while those living inside threw back slabs of masonry and bricks.

Police fired tear gas and stun grenades to keep the protesters back and a tense standoff followed. Witnesses reported at least three people hurt in the clashes.

The attempted storming of the courthouse followed an anti-immigrant demonstration, with scores of protesters waving banners with slogans such as "foreigners means crime" and "we have become foreigners in our own country."

Left-wing and immigrants' rights groups staged a counter-demonstration and riot police kept the two sides apart.

Greece is on one of the main smuggling routes for immigrants heading to Europe, with tens of thousands entering the country each year. Authorities say the country's location at Europe's eastern frontier means Greece needs assistance to cope with the influx.

Thousands of the new arrivals head to the cities in search of work. But with the global financial crisis beginning to bite in Greece, both immigrants and aid groups say jobs are becoming scarcer, leaving many unable to pay for even basic necessities. Although Greece has not yet faced major layoffs, the economy is slowing and unemployment jumped to 9.4 percent in January.

Aid workers said Saturday that conditions at the courthouse had been allowed to spiral out of control and turn into a public health hazard.

"It's a lot worst now," said Maurice, a 22-year-old Algerian living among the estimated 500 squatters, mostly men from Morocco and Algeria, inside the old Appeals Court building. "We live in misery."

He, like all the other squatters willing to speak, would only give his first name for fear of trouble from the authorities.

"It is an epidemiological time bomb in the center of Athens," said Nikitas Kanakis, head of the Greek section of the medical aid group Medecins du Monde (Doctors of the World), which set up a mobile medical unit outside the building Friday.

The immigrants live amid piles of rubbish and human waste in former judges' offices. Several men share a room, with most using cardboard covered with the occasional blanket to sleep on. With no sanitation, they use empty offices, the roof and even the corridors as toilets. The old spiral staircase, its bannister delicately curved, is slick with dirt.

Some have made the best of what they have, sticking posters on the wall, laying threadbare rugs over the grimy floor. One has even started up his own business, running a basic cafeteria. But the stench emanating from the building is so strong that it wafts across the street, a few hundred yards (meters) away from tourist hotels.

It is unclear when the first immigrants broke in, but many say they have been there for months. Medecins du Monde said the situation came to their attention in the last few days. They believe diseases such as hepatitis are rife, while many of those seeking their help were suffering from skin complaints such as scabies.

"We will be here all the time, but it's clear that we don't have the means to cover the massive health issues that this place has," said Yiannis Mouzalas of Medecins du Monde. He said authorities must help to sanitize and clean the building, and that they had been irresponsible in allowing the situation to become so severe.

"We consider it's not possible for this situation to have been created without (their) knowledge," he said. "We are afraid that they have chosen irresponsibility so that the problem is solved by the police and through racism."

Athens Deputy Mayor Eleftherios Skiadas told media that City Hall has no jurisdiction over "private buildings that have been abandoned to their fate for years."

The building is owned by an insurance fund and has been vacant since 2000. Rights groups want the building turned into a homeless shelter.