Islamist threats failed to halt Beirut’s week-long LGBT Pride festival – said to be the first in the Arab world – which ended successfully earlier this week.

More than 4,000 people attended parties, workshops, and conferences as part of the week-long event.

Homosexuality is still against the law in Beirut, which is the capital city of Lebanon, although earlier this year a top judge conceded that homosexuality should not be illegal, in what was seen as a landmark decision that could push the country toward decriminalisation.

On Saturday evening, the rainbow flag was flown outside 18 bars in Mar Mikhael, a popular nightlife district in the capital, according to The Daily Telegraph.

The flag was also flown outside the British and Dutch embassies in Beirut.

Hadi Damien, an organiser of the event, told The Daily Telegraph that attendance at the week-long festival had “surpassed all initial expectations”.

The festival was successful despite terror threats from Islamist groups. The first event was cancelled due to safety concerns after The League of Muslim Scholars in Lebanon condemned the event on social media.

Beirut Pride was scheduled to coincide with the International Day Against Homophobia and Transphobia.

Some 450 people – four times the anticipated number – attended a public storytelling on Monday evening.

LGBT rights activists in Lebanon were cheered by a potentially landmark court ruling earlier this year, when Judge Rabih Maalouf declared that “homosexuality is a personal choice, and not a punishable offence”.

His decision could put Lebanon on course to legalise homosexuality, which is currently an offence under Article 534 of its legal code, which prohibits sexual relations that “contradict the laws of nature”.

Homosexuality is currently punishable in Lebanon by up to one year in prison.

In 2016, some 50 activists gathered outside the Hbeish Gendarmerie in Beirut to protest against these laws, in the first protest of its kind in four years.

The event was organised by the Helem Association, a prominent LGBT rights group based in the country, which handed out placards that read, “homosexuality is not a disease” and “sex is not illegal – your law is archaic”.

In 2012, many demonstrated outside a court to demand an end to the ‘anal test’, a procedure that seeks to ‘prove’ whether somebody has had anal sex.

The Ministry of Justice has since asked police to end the practice.