A high court in Ghana has granted bail to 21 gay rights activists arrested three weeks ago for what police described as an unlawful gathering, the prosecutor said on Friday.

The 16 women and five men, who were arrested on May 20 at a hotel where they were attending a rights advocacy training, were released on a 5 000 Ghana cedi ($866) bail, the prosecutor said.

The arrest has drawn condemnation as lesbian, gay, bisexual and transgender people face widespread persecution in the West African nation, where gay sex is punishable by up to three years imprisonment.

Ghana has not prosecuted anyone for same-sex relations in years, but the LGBT+ community has reported a crackdown by authorities in recent months.

The group was denied bail twice, drawing condemnation from advocacy group the Ghana Center for Democratic Development, which said in a statement that it was appalled by the court’s handling of the matter.

“It is clear that gathering to educate people at a hotel venue on LGBT+ issues is not a criminal act or crime under the constitution or any statute,” the advocacy group said.

The case is expected to resume on a later day.

Previously, the 21 activists were denied  bail: