Ugandan activists launched a petition Wednesday at the constitutional court seeking to overturn tough anti-gay laws that have been condemned by rights groups as draconian.
Signed by Uganda's veteran President Yoweri Museveni in February, the law calls for homosexuals to be jailed for life, outlaws the promotion of homosexuality and obliges Ugandans to denounce gays to the authorities.
But the activists argue that the law was passed in parliament without the necessary quorum of lawmakers.
The 10 petitioners -- including two Ugandan rights organisations -- also claim that the law violates the constitutional right to privacy and dignity, as well as the right to be free from discrimination, and cruel, inhuman and degrading treatment.
"I have a very good feeling about it," the group's lawyer Nicholas Opio said after the hearing in a crowded courtroom.
He said that if the judges decide the law was not correctly passed by parliament, "the entire act will collapse".
Rights groups say the law has triggered a sharp increase in arrests and assaults of members of the country's lesbian, gay, bisexual and transgender (LGBT) community.
- 'Civilised' against 'barbarians' -
Western nations have also made a raft of aid cuts to Uganda in protest since the law was passed.
But outspoken anti-gay preacher Pastor Martin Ssempa, who was in court, defended the law and warned against the "judicial abortion of our bill" due to international pressure.
"Our teachings find sodomy as being repugnant, and our members of parliament were right in passing this law," Ssempa said.
"It is really a question between the civilised and the barbarians."
US Secretary of State John Kerry has likened the Ugandan law to anti-Semitic legislation in Nazi Germany.
Washington last month froze some aid programmes, as well as cancelling military air exercises and barring entry to the US for specific Ugandan officials involved in "human rights abuses", including against the gay community.
The White House said the legislation "runs counter to universal human rights and complicates our bilateral relationship".
Opposition leader Kizza Besigye has accused the government of using the issue of homosexuality to divert attention from domestic problems such as corruption scandals or Kampala's military backing of South Sudan's government against rebel forces.
But homophobia is widespread in Uganda, where American-style evangelical Christianity is on the rise.
Gay men and women face frequent harassment and threats of violence.
With tabloid newspapers printing pictures of dozens of people alleged to be gay, scores have fled the country.
Human Rights Watch and Amnesty International said in a joint report in May that Uganda's LGBT community had faced a "surge in human rights violations", with people being arrested, evicted or losing their jobs.
The report claimed at least one transgender person had been murdered since the law was passed.