Transgender people have been fleeing the sharia-ruled Indonesian province of Aceh amid fears of further violence, an exodus that comes in the same week the national parliament proposed criminalising gay and all extramarital sex.

In the provincial capital of Banda Aceh, scores of transgender people have fled following the arrest and public shaming of 12 trans women in neighbouring North Aceh.

The 12 women, known as waria, were arrested on Saturday night when police, accompanied by locals, raided beauty salons and forced them to strip off their shirts and have their hair cut in public.

In detention the waria were compelled to undergo an ad hoc form of “gender re-education”, which included wearing men’s clothing, physical exercises such as push-ups and sit-ups, and instruction on lowering their voices, until they were deemed suitably “macho”.

Sources close to those detained say they were also stripped naked and beaten by police, and upon release are suffering psychological trauma.

“We felt so sad and angry when we heard about the arrest of the waria and their inhumane treatment,” said Reza, a representative from an LGBT association in Aceh, who asked for his real name to be concealed. “After that we got really scared because we could imagine it happening here.”

A message circulating on Whatsapp detailing a planned Friday demonstration in support of the “eradication of LGBT” has sparked fears that more raids are to come.

The message lists more than 50 groups, including the notorious FPI, or the Islamic Defenders Front, among those scheduled to join after Friday prayers at Banda Aceh’s Baiturrahman Grand Mosque.

“A lot of the salons have closed because of rumours that fundamentalists will raid them after Friday prayers, so they have temporarily closed down and evacuated – about 40 so far have left,” said Reza. “Waria are very easy to spot so I think they will stay away until things calm down.”

Since the flogging of two gay men in Aceh last May – Indonesia’s first public caning for homosexuality – LGBT people in the province have lived in increasing fear for their safety. Local rights group say hate speech is on the rise, with people using social media to spread messages about “cleansing” Aceh of gay, lesbian and trans people.

Hartoyo, a gay man who was tortured by Aceh police in 2007 and is now a Jakarta-based activist, said he received regular death threats. The majority of waria he knows in Banda Aceh have closed their salons in recent days in fear of being attacked, and have either fled or are lying low.

“The politics is very, very dangerous for the majority of LGBT in Indonesia right now but specifically in Aceh it is even more dangerous.”

Based on its special autonomy provisions, Aceh is the only Indonesian province that can adopt sharia bylaws, including laws that make gay sex punishable by 100 lashes.

But across Indonesia, LGBT people have been targeted in police raids at private residences, hotels and clubs, with 300 arrests in 2017, according to Human Rights Watch.

In the lead-up to an election year, regional elections and the 2019 presidential vote, speaking out in defence of LGBT rights carries significant political risk.

A recent survey found that nearly 90% of Indonesians who understood the term LGBT felt “threatened” by the minority and said same-sex relations were not permitted in their religion

The national parliament this week drafted revisions to the criminal code that would outlaw not only same-sex relations but all extramarital sex. Committee members said the article on gay sex had widespread support.

Activists have expressed concern over the move, while an online petition against the revision has attracted more than 35,000 signatures.

“Maybe this is the first step of the sexual revolution, the inspiration to fight back,” said LGBT activist Hartoyo, trying to sound an optimistic note. “Maybe it will make us open our eyes.”