How can we stop the next Omar Mateen over here in America? The short answer is: we can’t. Semi-automatic rifles designed for military use are far too easy to obtain in the United States and anywhere that people gather is a potential target. A skilled gunman can shoot eight deadly rounds a second, killing as fast as his finger can flutter the trigger of an AR-15.

Terrorists acting alone, or with the help of a single family member, create no network and leave a minimal digital trace. “It’s a challenge to Intelligence. There’s not an organisation or conspiracy to penetrate. We don’t have an x-ray for a man’s soul,” says Rand Corporation terrorism expert Brian Michael Jenkins.

The longer answer is that spotting future mass murderers and preventing or dissuading them from carrying out their plans requires a complex, sensitive and nuanced approach involving everything from high schools and courts, to the FBI and ordinary folk in their own neighbourhoods. But that's a hard sell politically at the best of times and a non-starter in an election year. The louder the demands to “do something” become, the less likely we are to act effectively.

On May 21, ISIS spokesman Abu Muhammad al-Adnani urged jihadis to make the Islamic holy month of Ramadan a “month of calamity” in the United States and Europe. “Know that inside the lands of the belligerent crusaders, there is no sanctity of blood and no existence of those called ‘innocents,’” he added.

It appears that Mateen got the message. On consecutive days, he went to the St Lucie Shooting Centre and bought semi-automatic guns: a Sig Sauer MCX .223 caliber rifle with a magazine for thirty bullets, and a Glock 9mm pistol holding seventeen rounds.

He knew his chosen target well. Regulars said he had been to the Pulse nightclub many times. Sometimes he became drunk and belligerent. On at least one occasion he flirted with another patron on a gay messaging app.

In the aftermath of the massacre, there was a rush to define Mateen. Why couldn’t liberals accept that he was a radical Islamist terrorist? How could conservatives not see that he hated gay people because he hated himself? Partisans chose a definition to suit their political agenda.

According to Adam Lankford, author of The Myth of Martyrdom, most so-called ‘lone wolf’ attackers are confused, angry young men who find justification in ideology, rather than being inspired by it.

“Ideology alone doesn’t get someone there,” he says. “The people who are committing suicide attacks are often people who don’t have that strong an ideology so much as an unhealthy fixation or a desire to frame themselves as part of something bigger than themselves.”

ISIS knows this. “Do not ask for anyone’s permission,” al-Adnani told would-be jihadis in 2014. The Islamic State offers alienated young Muslims a brand, an excuse to express their rage and a loophole in the Koran’s teaching that suicide is a crime against Allah.

“The concern is about copycats,” Lankford says. “ISIS wants the next person that’s disturbed and looking for meaning to do something like this in their name. They are saying ‘come and be part of an organisation of holy warriors.’ And the reality is they’re preying on people with mental health problems. We need to expose that hypocrisy.”

Delegitimising radical interpretations of Islam requires deep and constructive engagement with the Muslim community. This is hardly a new idea - it has been central to efforts to combat homegrown extremism in the US and Europe since before the Islamic State existed - but in an election year, politicians are as likely to talk about it as they are to promise to raise taxes.

Republican presidential nominee Donald Trump offered an alternative solution: invade Syria. “We have generals that feel we can win this thing so fast and so strong,” he told Fox & Friends. Hillary Clinton touted the Obama administration’s policy: “We should keep the pressure on, ramping up the air campaign.”

The US-led coalition has conducted more than 12,000 airstrikes in Iraq and Syria. Dropping even more bombs may “degrade” ISIS, to use President Obama’s favoured term, but it will not destroy it, nor prevent further terrorist atrocities back home.

What the Islamic State wants most of all is to face “crusaders” on the field of battle. In his 2014 address, al-Adnani taunted Obama: “You said, O mule of the Jews, that America will not be dragged into a ground war, but it will [indeed] sink into a ground [war] and will be dragged to its death.” This is the response that terrorist attacks explicitly seek to provoke.

The day after the Pulse shootings, Trump repeated his call for Muslims to be banned from entering the United States. Never mind that Mateen, San Bernardino attacker Syed Farook, and Fort Hood shooter Nidal Malik Hasan were all born here. Trump falsely accused the government of accepting Syrian refugees “without a screening plan,” adding that “this could be a better, bigger more horrible version than the legendary Trojan horse ever was.”

This drew a sharp retort from Obama. “If we fall into the trap of painting all Muslims with a broad brush and imply that we are at war with an entire religion, then we are doing the terrorists’ work for them,” he said. In his pre-Ramadan call to arms, al-Adnani reminded believers that “there are only two armies, two camps, two trenches.” Nativist Republicans are the Islamic State’s one essential ally.

Trump’s proposed crackdown, and his unfounded allegations that Muslims knew about the San Bernardino plot and failed to tell authorities, were popular in the Republican primary, but in the latest CBS and Bloomberg polls, more than three in five voters said they opposed his immigration plan.

In the fortnight after the terrorist attacks in Paris last November, there were at least eighty attacks on Muslims and mosques in the USA. “It’s the rhetoric, the vitriol that makes it socially acceptable to target members of the Muslim community,” says Zahra Billoo, a spokesperson for the Council of American-Islamic Relations.

“The Muslim community has already demonstrated that they will call law enforcement if they hear about a violent plot being planned in their community… The first step is for law enforcement to not treat the Muslim community as inherently suspect, to acknowledge the damage that has been caused by more than a decade of surveillance and profiling.”

Obama has been outspoken about the need for constructive engagement with Muslim communities. Few doubt his personal conviction on that score, but he’s also not running for office. Clinton cannot be so forthright.

In the short term, the likeliest response to the carnage in Orlando is more surveillance and tighter security. “If we look at shopping centres and cinemas and such, there’s likely to be armed private security with rifles and metal detectors. I don’t think that’s the best, most comprehensive approach, but it does reassure the public,” says Dr Peter Weinberger, a researcher at the University of Maryland with a focus on combating violent extremism.

“But we need to know that we can’t simply arrest or surveil our way out of the problem. We won’t be able to eliminate terrorism but we can bring the numbers down with a more thoughtful, comprehensive approach that actively involves community members working with the authorities.”

As Republicans argued that the carnage in Orlando demonstrated the need to do something about immigration, so Democrats, just as predictably, demanded that Congress do something about guns.

“The cynic would say ‘if the Sandy Hook shooting, where twenty elementary school children were killed, didn’t fundamentally change American policy, this won’t either',” says Lankford. On the day of Mateen’s attack, there were forty-two other reported shootings in the USA, killing at least eighteen people.

After the attacks in San Bernardino last December, Democrats in Congress drafted the Denying Firearms and Explosives to Dangerous Terrorists Act. Who could possibly vote against a bill with a name like that? Fifty-three Republican Senators.

Clinton has revived the idea of blocking people on the government’s terrorist watchlist from buying weapons. “If you’re too dangerous to get on a plane, you are too dangerous to buy a gun in America,” she said.

Although this sounds like common sense, the watchlist is a flawed document, at once too broad and full of holes. In 2014, the online investigative magazine The Intercept revealed that of 680,000 people on the Terrorist Screening Database more than 40% are described as having “no recognised terrorist group affiliation.” Mateen was on the list from 2013-14, but was taken off after the FBI interviewed him for the third time and concluded he posed no threat.

“I frequently represent people who are surveilled by the FBI for no reason other than their religion or politics,” says Billoo. “To think that one of our future presidents would be willing to give that power to law enforcement, to mark people as suspicious, is terrifying.”

California’s “gun violence restraining order” offers one alternative template. There, family members or law enforcement officials can ask a judge to order people to surrender their firearms, pending a full hearing, because they pose a threat to themselves or others.

Trump’s poll numbers have been in freefall since he made racist accusations of bias against a Californian District Judge, Gonzalo Curiel. The most recent Bloomberg poll found Clinton leading 49% to 37%. Almost two-thirds of the women surveyed said they could “never” vote for Trump.

Guns are a promising wedge issue for him. In the Democratic primaries, Clinton ran to the left of Bernie Sanders on gun control. She favours reintroducing the assault weapons ban that was in place from 1994 to 2004, but will be careful not to let the election become a referendum on what rights are protected by the Second Amendment.

The question of how to prevent further attacks is certain to come up in presidential debates. Trump will talk about controlling immigration and placing mosques under surveillance. Clinton will argue that we should restrict access to firearms. They will presumably agree about the need to crush ISIS. In an election year, there is no time for a discussion of policies that might actually prevent the next atrocity.

“The data shows that in 70-80% of cases, more than one person in their family or their peer groups knew about the threat and didn’t take any action, partly because they didn’t know what they could do and what avenues they could take,” says Weinberger. A former colleague of Mateen’s said he “talked about killing people all the time.”

A programme to reduce school shootings in Virginia provides one promising template. “Law enforcement professionals, counsellors, social workers, school administrators take steps to see if the threat is imminent or serious and what can be done,” says Weinberger. “A preventitive, multi-disciplinary team approach will likely need to be deployed on a larger level in the United States.”

“Society simply doesn’t have good ways of intervening in these people’s lives,” says Jenkins. “We can put people in jail or we can cut them loose and not interfere with their freedom. Do we have a governmental, social, mental health machinery for intervening in lives, one on one? That’s much more difficult.”