As the US mourns the victims of the Orlando mass shooting – the deadliest such incident in the country's history – people are asking how can such crimes be prevented in the future?
On Sunday night at 2:02 am, Omar Mateen walked into the gay nightclub Pulse in Orlando, Florida, before proceeding to shoot 49 people dead.
Not long after the incident, SITE intelligence reported that the DAESH terrorist organisation claimed the attacker was one of their fighters.
But was what took place that night only an ideologically motivated terrorist attack, or is it better thought of as the bloodiest in a long history of similar incidents?
Who was Omar Mateen?
Omar Mir Seddique Mateen was a US citizen born in New York to Afghan parents.
The 29-year-old lived in Port St. Lucie, a city about 125 miles (around 200 km) from Orlando.
Mateen had no apparent criminal convictions, but FBI Agent Ron Hopper said he was interviewed by the FBI twice in 2013 and once in 2014 for having alleged ties to terrorist groups.
Hopper said the agency could not previously prove that Mateen was connected to any terrorist groups even if he had been on the FBI's radar.
According to Congressman Adam Schiff, Mateen declared allegiance to DAESH immediately before the killings. It's not yet known whether the group orchestrated the attack or took advantage of the incident to promote itself.
His father, Seddique Mateen, had a different take. Speaking to local channel Fox35 Orlando, he said, "When someone becomes radical, they grow long beards and they wear clothes that you know, long clothes, and I don't think religion or Islam had nothing to do with this."
He suggested that his son carried out the killings because he got angry after seeing two gay men kissing in Miami in front of his three-year-old son.
In a strange twist, it later emerged that some patrons of Pulse had seen Omar Mateen attend the gay nightclub for years before the shooting.
One of them, Jim Van Horn, told the Associated Press that Mateen was a "regular" who "was trying to pick up people. Men."
Mateen's hostile and possibly conflicted attitude towards homosexuality – whether it derived from his religious views or underlying personal issues, or both – reveals the reason for his choice of target, but by itself is not enough to explain why he murdered 49 people.
After all, many people hold opinions seen as prejudiced or extreme by wider society, but few go on killing sprees likely to result in their own deaths.
According to his former wife, Sitora Yusufiy, Mateen was frequently violent:
"A few months after we were married I saw his instability, I saw his bipolar, and he would get mad out of nowhere, and that's when I started worrying about my safety," she said after the attack.
"Then after a few months he started abusing me physically, very often, and not allowing me to speak to my family, and keeping me hostage from them."
Dan Gilroy, who worked alongside the mass shooter as a security guard, said Mateen disturbed him with racist, sexist and homophobic comments.
"I quit because everything he said was toxic. This guy was unhinged and unstable," Gilroy said.
"He was an angry person, violent in nature and a bigot to almost every class of person."
Both of these accounts suggest that Mateen was aggressive, abusive and suffered from some kind of mental health problem. They are consistent with evidence that the majority of mass shooters have a past history of violence and mental illness.
Many people suffer from mental health problems and only a small fraction of those engage in violent behaviour, let alone mass murder.
Still, Mateen's psychological state might help explain why a man who already held radical views felt ready to act on them.
Only the latest mass shooting
The massacre at Pulse was the deadliest mass shooting in the history of the United States. It is distinct from previous incidents simply due to the size of the death toll.
It has also been linked to DAESH, which in the minds of many Americans means it was not merely a terrible crime but an act of war by a national enemy. In this sense it's similar to the mass shooting which took place last December at a charity function in San Bernardino, California.
Although mass shootings are generally not associated with international terrorism, it's still possible to draw useful comparisons with similar incidents in which the perpetrators had different or non-existent ideological motivations.
According to data collected by Mother Jones magazine, more mass shooting incidents and deaths have taken place in the US since 2005 than in the previous 23 years.
In an article in Scientific American, criminologist Frederic Lemieux says that according to his research, 78 mass shootings took place in the US between 1983 and 2013, almost twice as many as in 24 other similarly wealthy countries combined.
The only way to tackle the problem is to understand how such incidents are able to take place, and that requires looking for links between past incidents – including the latest one in Orlando.
One point of similarity is that the overwhelming majority of those carrying out such attacks are male. One exception was Tashfeen Malik, a Pakistani American who took part in the shooting in San Bernardino alongside her husband Syed Rizwan Farook.
Another similarity is the preferred choice of weapon. Mateen used a Sig Sauer MCX assault rifle in the attack on Pulse – a gun similar to the AR-15 type assault rifles used by mass shooters such as Adam Lanza, who killed 20 children aged between six and seven at Sandy Hook elementary school in 2012, and James Holmes, who killed 12 and injured 70 during a screening of the movie The Dark Knight Rises at a cinema in Colorado.
In addition, as already mentioned, mental illness is strongly over represented in mass shooters. According to data compiled by Mother Jones Magazine, 15 out of the 25 deadliest mass shooters had a history of mental illness.
The same data states that 82 percent of the weapons used in mass shootings in the last 20 years were acquired legally. Mateen also legally acquired the firearms he used in the attack on Pulse.
According to research by Lemieux, tighter regulations in developed countries – such as stringent background checks on would-be gun owners' criminal and mental health histories – are a major reason for the much smaller incidence of mass shootings in these countries.
It seems, then, that tightening gun regulation would be one way to prevent further mass shootings, by making it more difficult for people with a history of mental illness or violence to acquire such weapons.
However, tightening gun regulations in the US will not be easy when the right to own a firearm is enshrined in the constitution, and when politicians depend on the support of gun owners to be elected.
Survey data released in 2014 by the Pew Research Center broke down the demographics of gun ownership in the country:
"Overall, about a third of all Americans with children under 18 at home have a gun in their household, including 34% of families with children younger than 12. That's nearly identical to the share of childless adults or those with older children who have a firearm at home."
Following the attack on Pulse, Democratic Presidential candidate Bernie Sanders said a lack of adequate gun control regulations was to blame for incidents like the one in Orlando.
"We should not be selling automatic weapons which are designed to kill people," Sanders said on NBC's "Meet The Press," while commenting on the shooting.
"We have got to do everything that we can on top of that to make sure that guns do not fall into the hands of people who should not have them, criminals, people who are mentally ill. So that struggles continues."
Recalling the killing of children in the Sandy Hook massacre in 2012, US President Barack Obama made comments along the same lines during a tearful speech in January advocating greater gun control in which he said, "We know we can't stop every act of violence, every act of evil in the world. But maybe we could try to stop one act of evil, one act of violence."
But some gun rights advocates preferred to place the emphasis on Mateen's religious views:
You think this guy would've been stopped by gun control? Why is everyone surprised? Islamic radicals are coming for us. Arm yourselves.— Gaindalf the White (@JRRSwolekien) June 12, 2016
Republican presidential nominee Donald Trump, who frequently boasts of being endorsed by the National Rifle Association – the main gun lobby in the US – accused President Barack Obama of being afraid to use the words "radical Islamic terrorism" with respect to such attacks:
Is President Obama going to finally mention the words radical Islamic terrorism? If he doesn't he should immediately resign in disgrace!— Donald J. Trump (@realDonaldTrump) June 12, 2016
Obama hit back in response on June 14, saying, "The reason I am careful about how I describe this threat has nothing to do with political correctness and everything to do with defeating extremism."
"Are we going to start treating all Muslim-Americans differently? Are we going to start subjecting them to surveillance, discriminating against them for their faith?"
Surprisingly, following this spat, Trump went on to say on June 15 that he would back new restrictions on gun sales – but only to suspected terrorists.
So perhaps a new consensus might be arising on the need to review gun legislation, although what form any new regulations might take will likely remain a matter of heated debate for years to come.
That debate might end if it's eventually agreed that motivation is a secondary issue with respect to mass shootings, and the greater threat lies in disturbed and unstable individuals with violent pasts – just like Omar Mateen – having easy and legal access to guns.