A demonstrator lights candles Friday at a rally in Birmingham, England. (Eddie Keogh/Reuters)

BIRMINGHAM, England — When alerts went off Wednesday, breaking the news of the devastating London terrorist attack, many in Birmingham hoped that the trail would not lead to their city, which is approximately 100 miles to the north of the capital. But the next morning, helicopters circled over Birmingham, and residents there immediately suspected the reason.

It was former Birmingham resident Khalid Masood who had committed the attack.

Now his former neighbors are being asked to explain why.

For years, the city has fought its image as a “hotbed of terrorism,” which emerged because many of Britain’s violent extremists are in some way connected to it. Some of Britain’s most deprived Muslims live in districts where poverty, crime and unemployment have played into the hands of radicals for decades. But many local Muslims voiced fears Friday that the current debate about the city might end up worsening the situation of Muslims in their community and across Britain.

“You cannot fight extremism by putting a community with its back against the wall,” said resident Hamayoon Sultan, 38, who was leaving Birmingham’s central mosque after midday prayers.

“There is a lot of anger in the community. We live peacefully together, and then one person comes and destroys it all,” said Muhammad Afzal, the mosque’s chairman.

Muslim men pray Friday at Birmingham Central Mosque after observing a minute of silence in memory of the victims of the Westminster attack. (Joe Giddens/PA via AP)

Since Wednesday, there has been a sharp rise in hate emails and threats against Birmingham’s central mosque. The tensions threaten to undo years of progress that have put the city at the forefront of British counterextremism efforts.

“In reality, the collaboration between authorities and the local community has so far worked better in Birmingham than on a national level,” said Chris Allen, a sociologist at the University of Birmingham.

This has not always been the case in Britain’s second-largest city, where more than 20 percent are Muslim. In 2010, authorities installed surveillance cameras across the city to monitor the movements of Muslims suspected of terrorism — placing all Muslims under universal suspicion, critics argued at the time. The project was stopped, but by then, it had already severely damaged relations between Muslim community leaders and authorities.

“The Muslim community in Birmingham has long felt under watch,” said Raffaello Pantucci, director for International Security Studies at the Royal United Services Institute in London.

In recent years, however, there has been a dramatic change, community leaders and experts said.

A minute of silence was held at the central mosque early Friday afternoon in the presence of Police Commander Mak Chishty, who is Muslim. But the show of unity could hardly hide the fears and the anxiety of many Muslims in the city. They worry that there will inevitably be a backlash against their community in the coming weeks.

Asked by a bystander why Muslims were being asked to condemn the attack of a man who “was not a real Muslim,” Chishty responded: “People like him damage you, and they damage me. We have to condemn such actions together.”

Many who were present appeared unconvinced. They struggled with the connection being drawn between their faith and Wednesday’s attack. Asked about the attacker, few used the word “terrorist” and instead referred to Masood as a “criminal.”

Khalid Masood. (Metropolitan Police/European Pressphoto Agency)

Masood, whose birth name is Adrian Russell Ajao, had lived for years in apartments in the British Midlands. Originally from Kent, he later moved to Birmingham. His former neighbors there knew him as a devoted gardener, but he otherwise remained all but invisible. Masood left few traces besides criminal convictions and a trip to Saudi Arabia.

“He was a convert,” said Ali Kahn, 25. “And his crimes are not connected to our religion. If he did this in the name of Islam, he didn’t understand our religion.”

“What this man did gives me a headache. Again and again, I’ve been asking myself why he did this,” Mohammed Elmokhtar, 43, said. “Muslims don’t do this.”

For Birmingham’s Muslim community and authorities, making the distinction is a balancing act. In Birmingham’s central mosque, for instance, visitors are now greeted by a booklet titled “Terrorism is Not Islam. 2nd edition.” Chishty would agree with that, but he wants Muslims to look out for potential terrorists, regardless.

Relations between the police and Birmingham mosques have significantly improved since 2014 because parents started to become afraid that their children might leave the city and join the Islamic State in Syria or Iraq. “The police is now much more welcome in Birmingham’s Muslim communities than it was three years ago, which has made things much easier,” Allen said. On Saturday, Birmingham residents were expected to march at a rally in the city center to condemn the attack and to show that “Muslims are united against terrorism,” according to the organizers.

But many here worry whether that will be enough to calm tensions. “I’ve always feared the day Britain would be struck by a major terrorist attack again,” said 43-year-old Mohammed Elmokhtar, standing at a vigil in Birmingham’s bustling city center Friday evening where candles were lit.

“This will make our lives much more difficult.”