LONDON—Within seconds of Wednesday’s terrorist attack, the Houses of Parliament went into lockdown. Doors were bolted shut by staff, and MPs were locked into the Chamber of Commons. Minutes later, militarized police from a response team set up in the wake of the Paris attacks spread through the surrounding streets. Doctors and nurses from St. Thomas’s Hospital, on the opposite bank of the Thames, ran to the aid of casualties lying on Westminster Bridge while a police boat plucked from the water an injured tourist who’d fallen from it. The speed of the response was striking.

The attack, which killed five people including a police officer and the attacker, was the largest London had seen since the bombings of 12 years ago, which killed more than 50. A lot has changed in the interim. When suicide bombers attacked tube trains and buses in 2005, initial reports suggested a power failure had been responsible for the explosions. The city’s Metropolitan Police (The Met) commissioner went on record two hours later to say he knew of "about six explosions," but it was "still a confusing situation." In fact there had been only four blasts. Within the hour after Wednesday’s incident, the Met announced via Twitter that the police were “treating this as a terrorist incident until we know otherwise.”

Although the emergency response to the 7/7 bombings was widely praised, the attack led to substantially increased investments in intelligence and counterterrorism capabilities in the U.K. The attacks triggered the creation of the country’s national counterterrorism strategy (CONTEST) and the establishment of a Joint Terrorism Analysis Centre (JTAC), based in the headquarters of Britain’s domestic intelligence service MI5. In 2007, a new office to lead the country's counterterrorism efforts, the Office for Security and Counter Terrorism (OSCT), was set up.

Both JTAC and OSCT specialize in synthesizing and coordinating counterterrorism responses across different government agencies. JTAC is also the group that decides the national terrorism threat level ratings that inform bodies like The Met, which for has for some time now indicated that an attack was imminent.

Hours after Wednesday’s incident, weary MPs started to emerge from the police cordon through a gate next to Westminster Abbey. There was a clear sense that the day’s events had been inevitable. Hilary Benn, an MP and former cabinet member for Tony Blair, said, “The tragic truth is this is the day that we feared would come, and it has.”

“I think we’ve all been expecting something like this to happen. … It doesn’t lessen the shock.”

Stephen Timms, another MP who was stabbed by an Islamic extremist at one of his constituency meetings in 2010, told me, “I’m sure there will be a review and a reflection about whether there are any changes that are needed, but in terms of our safety inside the building I didn’t feel at risk at any stage.”

Over December 2016, heavily armed police could be seen at Christmas markets and other landmarks in the U.K. The Met announced plans to deploy an additional 600 armed military personnel around London on a permanent basis. Equipped with high-speed BMWs to enable them to reach an incident as quickly as possible, the new team was trained to deploy at a moment's notice, which is exactly what happened on Wednesday.

Although the majority of London police officers are unarmed, there has been a very visible rise in armed police across the city since 2015; they now number 2,800 officers out of more than 31,000. This is unprecedented for a country where the vast majority of police officers are not routinely armed.

Increasingly elaborate, and more realistic, mock-ups of terrorist attacks run by police and security services are now a common fixture in London as well. Last week police staged a drill involving a siege on a Thames cruise boat, while 2015 saw London’s largest-ever counterterrorism exercise.

Part of the U.K.’s counterterrorism strategy also involved specifically training personnel to respond to an attack resembling the one that unfolded in Mumbai in 2008, when several attackers from Lakshar-e-Taiba marauded through the city with automatic weapons, ultimately killing more than 160 people.

Rod Jarman was a commander at the Met during the 7/7 bombings and now runs The London Policing College, which helps train officers to deal with incidents like terrorist attacks. “The police responded quickly to contain the actual person, I would say, as quickly as is possible. It seems like the training and practice came to work,” Jarman told me.

“We’ve seen the relationship with the intelligence services develop to a whole new level.  Intelligence moves quickly and well between organizations. [Westminster] is a tourist area where people want to come and it’s incredibly difficult to work out how much [security] you put in place for such a small number of people committing the risk.”

Statistics published by the EU law enforcement agency, EUROPOL, last year showed that a total of 211 failed, foiled, or completed terrorist attacks were reported by member states during 2015. Almost half of these (103) took place in the U.K. alone, suggesting not only that there are more attacks directed at Britain than other European countries, but that the vast majority are thwarted before they get to the point of the attack on Wednesday.

Samir Puri, an expert in counterterrorism at nearby King’s College London, told  me that a lot of eye witnesses have given visual testimony to how quickly the area was swamped with police and particularly armed police. They are some of the most highly protected buildings in the U.K. let alone the city.”

Wednesday’s attacks will likely lead to further refinements of the way London responds to threats to its security from terrorism. Sections of public transport were closed off or diverted in the immediate aftermath. By Thursday morning however, it was back to business as usual for London, and for most Londoners.