ISTANBUL (Reuters) - Turkish police deployed in central Istanbul on Sunday to enforce a ban on the city’s annual gay and transgender pride march, blocking off a main street and dispersing groups of demonstrators who gathered nearby.

Slideshow ( 8 images )

Police with riot shields and helmets sealed off entrances to Istiklal Street, where organizers had planned to hold the march before authorities announced the ban on Saturday, citing security concerns after threats from an ultra-nationalist group.

Small groups of people gathered in sidestreets waving rainbow flags, symbols of lesbian, gay, bisexual and transgender pride. Police fired rubber bullets to disperse one group, witnesses said, and detained several people.

Footage posted on the internet also appeared to show them firing tear gas at one location.

Istanbul’s pride march attracted tens of thousands of people in the past, making it one of the biggest in the Muslim world. But in 2015 it was broken up by police and it was banned last year and again this year after threats from the ultra-nationalist Alperen Hearths group.

The Istanbul governor’s office said it decided to prevent the demonstration out of concern for the security of marchers, tourists and residents.

“The true reason for the reactions towards a march that took place in peace for 12 years is hate,” organizers said.

“Our security cannot be provided by imprisoning us behind walls, asking us to hide,” they added. “Our security will be provided by recognizing us in the constitution, by securing justice, by equality and freedom.”

Istanbul has traditionally been seen as a relative safe haven by members of the gay community from elsewhere in the Middle East, including refugees from Syria and Iraq.

But although homosexuality is not a crime in Turkey, unlike many other Muslim countries, homophobia remains widespread. Critics say President Tayyip Erdogan and his Islamist-rooted AK Party have shown little interest in expanding rights for minorities, gays and women, and are intolerant of dissent.