When he spoke at the funeral service of murdered imam Maulama Akonjee and his friend Thara Uddin, New York City mayor Bill de Blasio hoped to send a message to the community.

“Since this horrible tragedy, the NYPD has been expending every resource and will continue to,” he told the hundreds of people gathered in a Queens parking lot. “You will see today, and in the days thereafter, extra NYPD presence protecting our mosques and protecting the people of our Muslim communities.”

The comments elicited cheers from the mostly Bangladeshi crowd from the Queens neighborhood where the imam and his friend were killed. Throughout the week that followed, several family members and leaders in the community reiterated calls for increased surveillance at mosques.

“They need to put cameras on every corner so the community can be safe,” Momin Ahmed, Akonjee’s son-in-law, said a few days after the killings.

But the calls for increased police presence and security cameras in mosques has divided Muslims across New York City. The memory of a controversial surveillance program carried out by the NYPD still looms large, with many still wary of the police force; some would prefer the community police itself.

“We have to respect this community, what they’re feeling, what they’re experiencing,” Debbie Almontaser, president of the Muslim Community Network, said. “Whether I agree or not with them, I respect their right.

“At the same time,” she added, “My commitment is unwavering in regards to our community safeguarding itself from within.”

Imam Maulama Akonjee’s son Saif Akonjee, second from right, speaks to media at the Queens criminal court last week. Photograph: Andrew Kelly/Reuters

Akonjee and his friend Uddin were both shot in the back of the head in broad daylight one week ago. Thirty-five-year-old Oscar Morel was arrested and charged with first-degree murder for the crime days later. While a motive has yet to be established, many in the Bangladeshi community believe it was an anti-Muslim hate crime and therefore want additional security for their mosques.

However, Almontaser and many groups in New York are hesitant to invite more police into the community after 2011 investigation by the Associated Press revealed that the NYPD was conducting an elaborate surveillance program of Muslim communities.

The demographics unit was established within the NYPD by a former CIA agent in the wake of 9/11. The unit sent officers to infiltrate student groups, mosques, religious bookstores, hookah bars and any predominantly Muslim areas to spy on people. It also worked on finding informants within the community, mirroring the actions of the CIA.

The revelations triggered protests, prompted a series of lawsuits, and ruptured the relationship between the Muslim community and police.

In the five years since, Almontaser said, things have improved, and the unit was disbanded by De Blasio.

“I think we have far better police and community relations than we did with [former] commissioner [Ray] Kelly and [former mayor Mike] Bloomberg,” Almontaser said.

Speaking to WNYC radio station, De Blasio said the community’s call for more policing indicated that relationships had improved.

But Fahd Ahmed, executive director of Desis Rising Up and Moving (Drum), said that the NYPD’s surveillance program has continued – under a different name, with different methods. Drum conducted a survey between 2011 and 2015 across New York City’s Muslim community and found that the surveillance was still happening.

“More electronic surveillance, a lot more surveillance through social media over the last three years since this new administration has come in,” he said. “Those concerns around surveillance, around people’s privacy, around people’s civil rights, and around entrapment cases still remains from our perspective and our membership.”

The Muslim Leadership Council held an emergency meeting last week in the wake of the killings of Akonjee and Uddin. The meeting, at a mosque in Jamaica, Queens, brought together Muslim leaders from across ethnic groups. Several imams indicated discontent at the prospect of inviting more police presence, particularly erecting cameras.

One who spoke of searching for alternatives was Ali Abdul Karim, head of security at the At-Taqwa mosque in Brooklyn. Karim is a martial arts expert, who began training in shuriken karate almost 50 years ago under the ninjitsu pioneer Ron Duncan. He is the head of his own security firm, and conducts security trainings for police and military.

On weekends, he teaches martial arts at the Brooklyn mosque. Sitting in a back room in the mosque, dressed in a black gi, he said the community was capable of policing itself.

Police surveillance cameras, top, are placed on a lamppost overlooking the area of the Masjid At-Taqwa mosque at Bedford and Fulton Streets in Brooklyn. Photograph: Bebeto Matthews/AP

“As a security professional and as a Muslim, what I’m saying is we police our own,” Karim said.

Karim cites the congregation’s ability to repel drug dealers from the neighborhood at the height of the crack epidemic of the 1980s as an example.

Inspired by the story of Noah’s ark, the congregation conducted a 40-day campaign to purify the neighborhood; they surrounded the block and did not allow customers to purchase drugs near the mosque.

“We dried up the demand. Once we dried up the sales, because they can’t make money, then there’s no operation.”

The initiative inspired many others around the country, Karim said, and fostered a strong relationship with police, who partnered with the group after the plan was successful.

But that relationship was damaged after the 9/11 attacks caused police to be suspicious of Muslims in the city. After the surveillance program was publicized in 2011, the mosque moved to remove all security cameras from the area.

“We don’t want people monitoring the masjid unwarranted,” said Karim, who himself was singled out by the demographics unit.

As head of security of the New York region in the Muslim Leadership Council, Karim will now offer security trainings to the boards of mosques on how best to safeguard the congregation without the help of police.

Ultimately, Drum’s Ahmed said the main way to ensure security is to build strong ties within and across the community in order to prevent things happening before they start.

“From our perspective, the most effective form of safety is strong communities,” Ahmed said. “The strongest protection is if we strengthen our own communities, strengthen [the] relationship across our communities.”