During his attack on a Florida nightclub, Omar Mateen placed an emergency call and told the operator that his actions were motivated by his hardcore Islamist beliefs.
However, Mateen's comments about Islam suggested that while his viewpoints were no doubt extreme, they were also confused, perhaps even incoherent.
Speaking to reporters today, FBI Director James Comey said that during his calls, Mateen said he was a supporter of Isis (Islamic State), the extremist Sunni group that controls a significant expanse of territory in Syria and Iraq. Media outlets linked to Isis later claimed Mateen as their own, describing him as "one of the soldiers of the caliphate in America".
Mateen also mentioned the 2013 Boston bombing during his calls. That attack, which left three dead and more than 260 injured, was carried out by the Tsarnaev brothers.
While the brothers were not found to be directly linked to a foreign group, they were partly motivated by a magazine published by al-Qaeda's affiliate in Yemen. (According to the Guardian, Mateen's admiration for the Tsarnaev brothers went back further. In 2013, Mateen is believed to have told the FBI that he knew the two bombers, though investigators later concluded that this relationship had been fabricated.)
Comey said that during the calls, Mateen also mentioned Moner Mohammad Abusalha, a fellow Floridian who had travelled to Syria to fight with Jabhat al-Nusra, the al-Qaeda affiliate in Syria. Mateen had been investigated by the FBI for his contact with Abusalha in 2014, but the case was quickly closed. Abusalha returned to Syria, where he killed himself in a suicide attack.
Further confusing matters, Comey also revealed that in "inflammatory and contradictory" comments to co-workers in 2013, Mateen had claimed to be a member of Hizbollah, the Shia militia based in Lebanon.
To be clear, these groups named by Mateen are NOT allies.
Isis and al-Qaeda both derive their theology from an extreme view of Sunni Islamism, but in practical terms the pair split in 2014, with the more established al-Qaeda publicly disavowing the actions of the more extreme Isis.
Jabhat al-Nusra, al-Qaeda's affiliate in Syria, often fights Isis in the Syrian conflict.
Hizbollah is a Shia Islamist group. In Syria, it supports the Government of Bashar al-Assad, effectively meaning it fights both Isis and al-Qaeda.
Comey suggested that Mateen may have not understood the distinctions among the groups.
Relatives have given mixed reports about the level of Mateen's religiosity, with some suggesting he preferred working out to studying religion.
He attended the Islamic Centre of Fort Pierce, Florida, though he is said to have rarely spoken. His Afghan father has filmed videos that appeared to offer support for the Taliban, a fundamentalist movement that also opposes Isis, though his messages also were sometimes incoherent.
Mateen certainly wouldn't be the first terrorist to cite Islam as justification for his actions while apparently being somewhat confused about the religion.
In one especially notorious case, two British men who were found guilty of terrorism charges in 2014 ordered Islam for Dummies, The Koran for Dummies and Arabic for Dummies from Amazon before they left for Syria.