This post was updated on June 13 at 1:05 p.m. ET.
This undated image shows Omar Mateen, who authorities say killed dozens of people inside the Pulse nightclub in Orlando, Fla., on Sunday.
Omar Mateen, 29, walked into a gay nightclub in Orlando, Fla., Sunday morning and opened fire, according to law enforcement. He was killed after a long standoff with police but not before he allegedly carried out the deadliest mass shooting in modern United States history.
We will no doubt learn much more about Mateen in the coming days. But here is what we know so far:
-- Mateen, 29, was born in New York in 1986.
-- The FBI's Ronald Hopper said Mateen first drew the agency's attention in 2013, when he made "inflammatory comments" to co-workers about having ties to terrorism.
Orlando Police Department via AP
This undated image provided by the Orlando Police Department shows Omar Mateen, the shooting suspect at the Pulse nightclub in Orlando, Fla.
Orlando Police Department via AP
FBI Director James Comey said that at the time, Mateen was working as a contract security guard at a local courthouse. He told his co-workers he had ties to al-Qaida and Hezbollah and that he hoped police would kill his wife and child so he could martyr himself.
"In the course of the investigation, Mateen was interviewed twice," Hopper said. According to Comey, Mateen told them he made the comments out of anger because he thought his co-workers were teasing him about being a Muslim.
The investigation was closed after 10 months.
-- Hopper added that the FBI investigated Mateen yet again in 2014 when he was linked to Moner Mohammad Abu-Salha, a U.S. citizen who who blew himself up that year in a suicide attack in Syria.
Mateen, said Comey, went to the same mosque as Abu-Salha. During the investigation, they spoke to one witness who said they were concerned that Mateen had watched the videos made by the radical cleric Anwar al-Awlaki.
The witness said, however, that Mateen then got married and had a child so they were no longer concerned.
-- According to public records, Mateen has had a firearm license since September 2011. He was also licensed to be a security officer.
-- In a statement, the global security company G4S said that Mateen had been an employee since Sept. 10, 2007.
"Mateen was subject to detailed company screening when he was recruited in 2007 and re-screened in 2013 with no adverse findings," the company said. "He was also subject to checks by a U.S. law enforcement agency with no findings reported to G4S."
G4S provides security in many places, including Afghanistan and Iraq.
-- Hopper said that Mateen legally bought two weapons, a handgun and a long gun, in the past several days.
-- Hopper said Mateen called 911 during the shooting spree to pledge his allegiance to the Islamic State.
-- Mateen's father, Meddique Mir Mateen, told NBC News, that "this has nothing to do with religion." A couple of months ago, the father told the network, Mateen was angered when he saw two men kissing.
-- Public records show that Mateen was married in 2009. The Washington Post spoke to a woman whom they identified as his ex-wife. She described Mateen as unstable.
"He beat me," she told the newspaper. "He would just come home and start beating me up because the laundry wasn't finished or something like that."
Public records show that Mateen and his wife were divorced in July 2011.
-- In a press conference in Boulder, Colo., on Sunday night, Mateen's ex-wife described her former husband as "mentally ill" and "disturbed."
She reiterated that he had been physically abusive and thanked her family for rescuing her from the violent relationship.
She said he wanted to be a police officer and was a licensed gun owner while they were married.
-- NPR member station WNYC reports that Mateen's parents moved to New York from Afghanistan in the 1980s. One neighbor, who spoke on condition that the station did not use his name, said the family was devoted to its children.
"[Mateen] could've been maybe 4 when he was here," the neighbor said. "[They] didn't have enough money to buy the food so the children were getting hungry."
Editor's note: We've updated the text to reflect that the Orlando attack represents the deadliest mass shooting in modern U.S. history, rather than in all of U.S. history. You can read more about our thinking here.