Egyptian prosecutors have ordered the release of a transgender woman arrested in March on a string of charges including joining a “terrorist” group, her lawyer and a rights group said Monday.

Malak al-Kashef, 19, was arrested on accusations of joining a “terrorist” group and using social media with the aim of disrupting public order.

“The state security prosecution ordered the release of Malak al-Kashef,” lawyer Amr Mohamed said in a Facebook post.

Her release was also confirmed by a rights group, the Egyptian Initiative for Personal Rights.

Mohamed told AFP she was to be freed pending an investigation and that defence lawyers would discuss her release with the prosecution on Tuesday.

It was not clear when the decision will take effect, he said.

Kashef has been held in solitary confinement, according to Mohamed.

Her arrest prompted Human Rights Watch and Amnesty International to warn of the risks of possible “sexual violence” against her while in custody.

The trans activist has drawn attention since February 2017 when she spoke out about the transition process on a popular Egyptian talk show.

In online posts, she also chronicled cases of harassment by family members and in public after having transitioned from male to female.

In conservative Egypt, homosexuality is not explicitly banned but authorities regularly crack down on suspected LGBT people under a “debauchery” law, drawing condemnation from right groups.

In January, an Egyptian court sentenced a television host to one year in prison for interviewing a gay man last year.

Egypt’s top media body issued a decision “banning the appearance of homosexuals or promotion of their slogans” after the rainbow flag symbolic of the LGBT community was raised at a Cairo concert in 2017.

The previous year a court rejected a trans individual’s request to change name and gender on the ID card.