One of the Arab world’s most visible advocacy groups defending the rights of lesbian, gay, bisexual, transgender and intersex people is facing closure following legal threats by the government.

Association Shams has been officially operating in Tunisia since 2015, helping the country’s LGBT community repeal article 230 of its penal code, a French colonial law, which criminalises homosexuality with up to three years in jail.

The government failed to permanently suspend Shams’ activities in a 2016 lawsuit, but is appealing the ruling. A hearing is scheduled for Friday.

Shams’ president, Mounir Baatour, said the appeal represents the Tunisian government’s seventh attempt to close the organisation, but it is more serious because it has been based on Islamic sharia law.

“The judicial harassment against our association has no legal basis, and reflects the homophobia of the Tunisian state and its will to discriminate and stigmatise the LGBT community, which is already marginalised,” Baatour told the Guardian. “Such harassment makes our work difficult and creates a climate of tension and fear among the team working for our association.”

Despite pressure, the country’s LGBT community is thriving. In January 2018, Tunisia held its first LGBT film festival in the capital, Tunis, organised by the group Mawjoudin (We Exist). It is one of the four officially recognised LGBT organisations in Tunisia, all of which have emerged since the 2011 revolution.

Achraf (centre left), a 26-year-old Tunisian artist, arrives at the opening of the annual Mawjoudin Queer Film Festival in Tunis in March. Photograph: Fethi Belaid/AFP/Getty Images

“If the Mawjoudin Queer Film Festival speaks to the increasing boldness and assertiveness of Tunisian LGBT activists, such an event was hardly imaginable a few years ago,” wrote Ramy Khouili and Daniel Levine-Spound in a recently published study, Article 230 – A History of the Criminalisation of Homosexuality in Tunisia.

Khouili said few countries in the region have an LGBT movement as developed as Tunisia, but he said the lawsuit against Shams was indicative of “the myriad ways” in which people seek to silence the voices of Tunisian gay rights campaigners.

Although the LGBT activism scene marks “a notable post-revolution achievement”, said Khouili, “we have seen no decrease in article 230 arrests and prosecutions, and there is little indication that parliament is willing to abrogate article 230 in the near future. As of now, article 230 continues to be widely implemented.”

In June last year, a commission established by the country’s president recommended the repeal of article 230, or a fine of 500 dinars (£125) instead of imprisonment. But the report was not legally binding and the anti-sodomy law has continued to land members of the country’s LGBT community in prison, and has also subjected them to anal examinations – a notorious police practice condemned by rights groups as intrusive, degrading and deemed a form of torture.

The number of arrests made by Tunisian authorities under the country’s anti-sodomy law increased significantly last year, Shams said. The group said 127 arrests were recorded in 2018, compared with 79 in 2017. At least 22 arrests have been made so far this year.

Baatour, who has had homophobic abuse scratched on his car, said he was concerned about the conditions under which LGBT people are held in jail in Tunisia.

Such detainees are often kept in a specific cell assigned to LGBT inmates. “Sexual assaults in prison are very common,” Baatour said.

Tunisians hold pro-conservative signs during a protest against proposed reforms that include equal inheritance rights for women and decriminalising homosexuality, in August 2018, Tunis. Photograph: Fethi Belaid/AFP/Getty Images

Ali Bousselmi, from Mawjoudin, said: “Tunisia is mostly a queer-phobic country.” He said that was why the group hadn’t been expecting the huge success of its first film festival. “More than 700 people attended [in 2018],” he said. “By the end of the first edition we felt that it was really possible to organise a queer festival in Tunisia.” The group held its second festival in March.

But challenges persist. On one occasion, staff of the hotel where LGBT activists were meeting called the police because of the presence of “some effeminate people”, Bousselmi recalled. On another occasion, a bank attempted to seize the group’s money because it realised that it was involved in promoting LGBT rights.

Such public levels of LGBT activism are rare in the Arab world. In Lebanon, the country’s infamous article 534 criminalises “unnatural sexual acts” but some level of activism is tolerated. The Lebanese indie rock band Mashrou’ Leila has a Muslim and openly gay frontman, and Helem, the country’s first LGBT community centre operates openly, although it is not officially registered.