Mrs. May said the election would go ahead on Thursday as planned.

The prime minister led an emergency meeting of her security cabinet on Sunday morning. In a statement afterward, she said the government would intensify its counterterrorism efforts to deal with Islamist radicalism at home and to try to restrict “the safe spaces it needs to breed,” both on the internet and in British communities.

“Everybody needs to go about their lives as they normally would,” she said. “Our society should continue to function in accordance with our values. But when it comes to taking on extremism and terrorism, things need to change.”

Mrs. May said that the government might extend the duration of custodial sentences for terrorism suspects, but that more needed to be done in binding communities together to combat what she called “a perversion of Islam,” adding, “There is, to be frank, far too much tolerance of extremism in our country.”

Mrs. May, who was home secretary for six years before becoming prime minister, has been pressing for a tougher line against Islamist extremism for some time. By stating on Sunday that police and security measures were insufficient, she was announcing a new effort, if re-elected, to break down what she sees as self-segregated communities and to be less delicate in confronting them.