Omar Mateen Credit Via Myspace
Omar Mateen Credit via MySpace

The Orlando gunman had pledged allegiance to the Islamic State and had been investigated twice by the F.B.I. for possible connections to terrorism but no ties could be confirmed.

The FBI has reported that the gunman, identified as Omar Mateen, 29, an American citizen whose parents were from Afghanistan, called 911 and talked about the Islamic State shortly before the massacre at the Pulse nightclub, the worst mass shooting in American history.

The F.B.I. first became aware of him in 2013 when he made inflammatory comments to co-workers alleging possible terrorist ties,” but could not find any incriminating evidence. In 2014, the bureau investigated him again, for possible ties to Moner Mohammad Abusalha, an American who grew up in Florida but went to Syria to fight for an extremist group and detonated a suicide bomb; the bureau concluded that the contact between the two men was minimal, and that Mr. Mateen “did not constitute a substantive threat at that time.”

The suspicions did not prevent Mr. Mateen from working as a security guard, or from buying guns. The federal Bureau of Alcohol, Tobacco, Firearms and Explosives said Mr. Mateen legally bought a long gun and a pistol in the last week or two, though it was not clear whether those were the weapons used in the assault.