BEIRUT — Dozens of people demonstrated outside the law courts in the Lebanese capital on Saturday to protest the use of anal "tests" on men suspected of homosexuality, which is a criminal offence in the Arab country.

The rally followed a July 28 police raid on a gay venue in a working class district of Beirut when 36 men were taken into custody and forced to undergo the examinations, reportedly to determine their sexual orientation.

Lebanon-based HELEM, considered the Arab world's leading lesbian, gay, bisexual and transgender rights group, called for the rally under the slogan: "Stand up against the tests of shame, vaginal or anal."

It also voiced solidarity with women subjected to so-called "virginity tests."

"We're here because we want a clear statement from the ministry of justice that these kind of tests should be completely abolished and punished by the law," said participant George Azzi.

"The syndicate of doctors has declared these tests are irrelevant scientifically and it's illegal for doctors to do these tests, but that doesn't mean police can't still request it," he said.

Men and women -- ranging from gay and lesbian young adults to a father and daughter -- chanted in unison and held banners that read: "United to abolish the tests of shame."

Other homemade signs struck a more sarcastic tone: "Honorable minister, before you test my anus, at least take me out to dinner," read one.

But for most, the tests were no laughing matter.

One sign read: "The cost of forensic rape: 125,000 Lebanese lira" (about $85), pointing out that the men subjected to the anal probes were being charged for the procedure.

Under Article 534 of the Lebanese Penal Code, sexual relations "contradicting the laws of nature" are illegal and violators may be punished by up to one year in prison.