Immigrants left the university building in Athens, the Greek capital, following a tense standoff with police [Reuters]

More than 200 illegal immigrants on hunger strike in Greece have ended a five-day occupation of a university in central Athens, following a tense standoff with police.

The immigrants left the Athens University Law School early on Friday, after being joined by scores of demonstrators. They then marched across the city together.

The group, who are mostly from north African countries, are demanding legalisation in the country which has been long-criticised for its handling of asylum seekers and illegal immigrants.

Around 90 per cent of illegal immigrants to the European Union use Greece as a gateway to the bloc.

But Greece says it cannot cope and those immigrants without papers should leave.

The country, which is also suffering from crippling debts, has seen rising tensions over the growing number of immigrants who come to seek asylum, and is planning to build a fence along a 12.5km section of its northeastern border with Turkey.

A number of small clashes broke out between police and pro-immigrant protesters during the university occupation, which began on Sunday.

Under Greek law, police are barred from entering university campuses, but academic authorities had lifted the university asylum on Thursday, handing police the rarely granted power to intervene.

"There is an agreement, the immigrants will move to another building," a police official was quoted by the Reuters news agency.

He said some details were not yet finalised, including how long the migrants would be allowed to stay in the new building.

The young men, who are said to work in agriculture and other menial jobs in Crete, started a hunger strike on Monday.

The government has already said there would be no mass legalisation.

Source: Agencies