Egypt's Administrative Court rejected on Tuesday an appeal against a decision by the interior ministry to deport a Libyan national on the grounds that he was alleged to be homosexual, and upheld what it said was the right of the ministry to deport homosexual foreigners and ban them from entering Egypt.
The court said its decision was taken to preserve the public interest and religious and social values.
The Libyan's deportation and subsequent ban from re-entry came after a complaint was filed against him with a misdemeanour court in 2008, describing him as homosexual.
It was not clear what the charges against the deported Libyan were and whether or not he was convicted.
The deportation decision by the interior ministry followed whereby it said it would deport gay foreigners and ban them from entry.
The Libyan appealed on the grounds that he was a graduate student at Cairo's Arab Academy for Maritime Transport and the ban prevents him from completing his studies.
Although homosexuality is not explicitly outlawed in conservative Egypt, those accused of homosexual behaviour or activity are often charged under laws that criminalise "debauchery" or the corruption of public morals.
Arrests and prosecutions of Egyptian men accused of homosexual activity have increased dramatically in recent months, rights advocates say.