As if to further punctuate the connection, the police announced Sunday that they had arrested an unidentified man in Birmingham as part of the investigation of Mr. Masood.
Members of Birmingham’s Muslim communities acknowledged the linkage between their city and Islamist extremism, which many attribute to poverty and drug abuse that make youths vulnerable to jihadist recruiters who operate like gangs. But Muslims in Birmingham also deeply resent what they see as a grossly unfair reputation, countering that most residents are proud and law-abiding.
Many also see their neighborhoods as reassuring refuges from the backlash of anti-Islam bigotry roiling Europe and elsewhere.
The bigotry has often focused on Birmingham. A few years ago, a Fox News terrorism commentator had to apologize for describing Birmingham as a “Muslim-only city” where non-Muslims “don’t go.”
Nonetheless, Birmingham, Britain’s second-biggest city behind London, has produced a disproportionate number of convicted Islamist militants, including some linked to the Sept. 11 attacks, and to last year’s bombings in Brussels.
So many Islamist militants have been born in Birmingham — or have passed through — that the Birmingham Mail newspaper once lamented that the city had the dubious distinction of “Terror Central.”
“The extremist schools of thought seem to have become more embedded in Birmingham than in other parts of the country,” said Nazir Afzal, the former chief crown prosecutor for northwest England, who is from Birmingham.
Mr. Masood, who converted to Islam in his late 30s, was born and raised in an affluent village in southeast England. He spent much of his adulthood in and around London, interrupted by jail time and two yearlong relocations to Saudi Arabia. But Birmingham was his last residence.
Birmingham was the birthplace of Britain’s first suicide bomber, the residence of a financier of the Sept. 11 attacks, and the place where Al Qaeda hatched a plot to blow up a commercial airliner in 2006. When a masked member of the Shabab, the Somali extremist group, celebrated the murder of the soldier Lee Rigby in a 2013 video, he listed Birmingham as the first source of its fighters.
The man who is believed to have recruited the militant known as Jihadi John, the Islamic State executioner with the King’s English accent, was from Birmingham, as was his closest associate. Other prominent militants who have come through the city’s underground networks include Abdelhamid Abaaoud, organizer of the 2015 Paris attacks, and Mohamed Abrini, a Belgian national who helped plot the 2016 Brussels attacks.
In 2014, Birmingham was at the center of a so-called Trojan Horse plot in which, it was alleged, a group of Islamist extremists had sought to infiltrate and take over two dozen state schools. A recent report by the Henry Jackson Society, a politically conservative research organization, found that one in 10 convicted Islamist militants in Britain come from five Birmingham neighborhoods.
David Videcette, a former senior counterterrorism official, said that Birmingham had a better established extremist network than London — a city of seven million — which helped to explain why, in his view, many investigations lead “back to Birmingham.”
Part of Birmingham’s allure to prospective militants is its diverse sprawl of Muslim neighborhoods where they can blend in easily, local activists said.
“It’s a hiding place or a passing place to do what they want to do, and keep a low profile,” said Mohammed Ashfaq, director of Kikit, a community organization that helps young people who are drawn to drugs and extremist ideology.
If a militant were to hide, for example, in Birmingham’s Muslim neighborhood of Sparkbrook, Mr. Ashfaq said, “no one looks at them twice.”
Birmingham is also much poorer than London, providing a more exploitable population for extremists, Mr. Ashfaq said, recalling how his organization dissuaded two youngsters from joining the Islamic State. Both were drug addicts.
“A lot of kids are on drugs, or from single-parent families, or who experience domestic violence,” Mr. Ashfaq said.
In the neighborhoods of Sparkbrook, Washwood Heath and Alum Rock, where many of Birmingham’s Muslims live, mosques dot the cityscape, some offering Shariah councils for family matters. After-school madrassas serve a growing demand for parents who want their children to study the Quran. Even state-funded schools often accommodate religious demands, allowing for lunchtime prayer, shortened days during Ramadan and optional head scarfs.
To many outsiders, the segregation is striking. But Muslim residents, particularly women, speak of their neighborhoods as safe havens from an increasingly hostile society.
“There is safety in numbers,” said Sara Begum, 20, shopping on Coventry Road, a bustling area where eateries advertise halal meat from Kashmir and Syrian cuisine. Ms. Begum, who wears a face-covering niqab, rarely leaves her neighborhood for fear of being insulted or worse. She said a friend’s head scarf had been ripped away by far-right youths near Birmingham’s downtown train station.
“I feel safe around here because a lot of other women dress like I do,” she said. “Other people look at this neighborhood, they see a lot of brown people and a lot of Muslims and they worry about security.”
Within hours of last week’s attack, Muslim women in Birmingham received text messages warning about the far-right English Defense League mobilizing, and urged them to stay inside after dark.
Small Heath Park, where girls in head scarves play soccer and men in Muslim garb huddle to share a picnic, feels like a different world than the city center, a 10-minute drive away.
There are recently arrived Somalis, third-generation Bangladeshis and European converts, like Alicia Fierens, who moved here with her Chinese husband, also a convert, six years ago because Belgium had become too anti-Muslim, she said. “We were having our first child and we didn’t want him to grow up with that,” she said. Birmingham is friendlier, “as long as you stay in the area.”
One problem, said Nicola Benyahia, who runs Families for Life, an independent organization that helps parents detect radicalization in their children, is the mistrust between Muslim communities and the authorities.
“It doesn’t help when the community feels on the defensive,” she said, sitting in a sparsely furnished first-floor office.
Residents were angered and appalled when the government in 2008 secretly placed hundreds of close-circuit television cameras in predominantly Muslim neighborhoods. “It didn’t feel like it was for our security,” Ms. Benyahia said.
But she readily acknowledged that recruiters prey on Muslim youths. Her son Rasheed, then 19, abruptly left for Syria in May 2015 and was killed six months later, which prompted her to start her charity to help other parents avoid the same fate.
Ms. Benyahia, a Welsh convert married to an Algerian, said she believed someone in Birmingham had radicalized her son. When her daughter once asked him, Ms. Benyahia said, he recoiled and responded, “Don’t ruin it for anyone else.”
Birmingham’s Green Lane Mosque, a red brick building with a clock tower that was formerly a public library, once had a reputation as an “incubator” of militants, Khalid Mahmood, a local lawmaker, said. Now the mosque seeks to counter them.
Last week the mosque quickly condemned the attack in Westminster, saying it would “only strengthen our ongoing work in exposing deviant extremist ideologies, to ensure that we safeguard vulnerable individuals susceptible to radicalization.”
Mr. Videcette, the former counterterrorism official, said extremist networks are run “like the mafia” and include bookshops that sell extremist literature. They also organize tours and talks involving hate preachers, he said, and use some mosques to raise funds.
“It’s a business for them,” he said. “When we say terrorism, people tend to think it’s about religion. It’s not. This is always about money.”
One man in Britain who blurred the boundary between religion and violent extremism is Anjem Choudary, a founder of Al Muhajiroun, which is classified as a terror organization.
Mr. Choudary, who is now in prison after he was convicted last year of encouraging support for the Islamic State, had preached in Birmingham several times in recent years. His entourage would arrive in big vans on Coventry Road, an area associated with conservative Islam, preaching and distributing leaflets.
“They turned religion into a gang-type thing, with thugs around him saying, ‘Come join our gang,’” said Mr. Ashfaq, the director of Kikit. Their message, he said, was “you can be cool, you can become a gangster jihadi.”
A picture with an earlier version of this article was posted in error. It showed a Sikh man — not a Muslim in Birmingham.