Prominent Zambian rights activist Paul Kasonkomona on Thursday pleaded not guilty to charges of promoting homosexuality, after appearing live on television to argue for gay relationships.
"I deny the charge, your honour," Kasonkomona said in his first court appearance since being detained Sunday on charges of soliciting for an "immoral purpose".
He was granted bail following an application by his lawyer and an outcry from rights groups.
The 38-year-old activist, who is heterosexual, was arrested in the capital on Sunday, minutes after he appeared on a live TV show where he openly advocated for gay rights.
Sources at the television station said police tried to stop the interview and take Kasonkomona off air but management refused.
Homosexuality is outlawed in Zambia, as in most African countries, and discrimination against gays and lesbians is rife.
South Africa is the only country on the continent to have legalised same-sex marriages.
Kasonkomona, whose wife attended the court hearing, was granted bail of 5,000 kwacha ($930).
He was ordered to return to court for trial on May 15, in what will be a rare court hearing on homosexuality in Zambia.
Arguing for bail to be granted, his lawyer Sunday Nkonde said he was HIV-positive and needed to be home to receive health adequate care.
Kasonkomona's lawyers have also filed papers in a separate court suing the police for wrongful detention.
He claimed that for the four days he was held by police he was unable to take his tuberculosis and anti-retroviral drugs at the prescribed times.
The medicines were in the custody of the police.
"He is on second line treatment for HIV and AIDS and also on tuberculosis treatment which medication... (was) administered to the plaintiff very late contrary to the medically prescribed times," read the papers filed on Wednesday.
In a landmark case last year, Zambia's High Court heard that HIV-positive prisoners were being denied access to life-prolonging drugs and a balanced diet.
Kasonkomona's arrest outraged human rights groups, which had been calling for his immediate release and for the "spurious" charges against him to be dropped.
It was "outrageous" that Kasonkomona had spent three nights in detention for "such a minor offence", said Anneke Meerkotter, a lawyer at the Southern African Litigation Center.
His "unlawful arrest and detention" was "a blatant attempt to silence anyone who promotes the human rights of sexual minorities in Zambia," she added.
Last week, a group of gay couples in Zambia attempted to register their marriages but were stopped.
The government later ordered the arrest of anyone practising homosexuality.
A Pew Poll from 2010 showed that 98 percent of Zambians are Christian and 85 percent believe in the literal interpretation of the bible.