Omar Mateen, of Port Saint Lucie, Florida, came to the attention of federal authorities twice prior to being identified as the gunman in the Orlando gay nightclub mass shooting, a senior law-enforcement source told The Daily Beast.

Mateen killed 49 people and shot more than 100 in total at the Pulse dance club early Sunday morning, in the deadliest mass shooting in American history.

The senior law-enforcement source reports Mateen became a person of interest in 2013 and again in 2014. The Federal Bureau of Investigation at one point opened an investigation into Mateen, but subsequently closed the case when it produced nothing that appeared to warrant further investigation.

“He’s a known quantity,” the source said. “He’s been on the radar before.”

The senior law-enforcement source told The Daily Beast that Mateen was born in New York and was married for a time to a woman from New Jersey.

That woman told The Washington Post that he repeatedly abused her during their marriage, which lasted from April 2009 to July 2011.

“He was not a stable person,” the ex-wife said. “He beat me. He would just come home and start beating me up because the laundry wasn’t finished or something like that.”

Mateen’s parents are from Afghanistan but he was not very religious, she said, adding that he “seemed like a normal human being.”

Mateen’s father, Mir Seddique, told NBC News that the sight of two men in Miami kissing angered his son.“We are saying we are apologizing for the whole incident,” the father added. “We weren’t aware of any action he is taking. We are in shock like the whole country.”The attack, he said, “has nothing to do with religion.”But the father may not be the most credible of sources. He’s a supporter of the Afghan Taliban, according to The Washington Post.

Mir Seddique Mateen appears to reside in Florida, but is said to be presently running for office in Afghanistan.

Florida incorporation papers indicate that a Seddique Mateen heads a non-profit organization, The Durand Jirga, Inc. The non-profit was formed in 2010 and is registered at the Port St. Lucie, Florida address where both the father and Omar Mateen appear to reside.

An online posting by the father insists that what is now the Northwest Frontier Province of Pakistan should be returned to Afghanistan.

“Long live Afghanistan,” a posting on Seddique Mateen’s Facebook page declares. “To Pakistan death, death, death.”

Two law-enforcement officials told The Daily Beast that immediately before starting his rampage, Mateen called 911 and pledged his allegiance to the self-proclaimed Islamic State. (A similar pledge was made online by the San Bernardino terrorists before they shot and killed 14 people last year.)

The first law-enforcement source told The Daily Beast there is no immediate indication that Mateen had any direct connection to ISIS. But ISIS recently called on Muslims across the world to attack targets in the West during the holy month of Ramadan, which began last week.

The message came in an audio recording from spokesman Abu Mohammed al-Adnani, released in May. Muslims around the world fast during Ramadan in honor of the first revelation from God to Muhammad. The terrorist group believes it to be a particularly opportune time for attacks.

“Ramadan, the month of conquest and jihad. Get prepared, be ready... to make it a month of calamity everywhere for the non-believers... especially for the fighters and supporters of the caliphate in Europe and America,” Adnani said.

The Amaq Agency, an ISIS media affiliate, later praised the attack and took credit for it. Yet there is no currently established link between Mateen and the terrorist outfit.

Mateen had a valid firearms license in Florida and worked as a security guard at a facility for juvenile deliquents.

Among the key questions still unanswered was whether the private security company where Mateen worked was aware of any propensity to violence and what kinds of background checks had been performed on him. Officials said Mateen had a gun license by virtue of his work as a security officer and that he legally purchased the weapons used in the attack.

Mateen had been employed since 2007 as a security guard with G4S, a large multinational security company that provides services to more than two-dozen juvenile-detention facilities in Florida.

Mateen’s ex-wife told The Washington Post that he worked at a juvenile-detention center near their home in Fort Pierce.

A spokesperson at the St. Lucie Regional Juvenile Detention Center, just outside Fort Pierce, declined to provide The Daily Beast with any information about Mateen or to confirm whether he worked at the facility. The spokesman directed all calls to the State of Florida Department of Juvenile Justice.

A spokeswoman there directed all queries to G4S, which released the following statement about Mateen: "We are deeply shocked by this tragic event. We can confirm that Omar Mateen had been employed by G4S since September 10th, 2007. Mateen was off-duty at the time of the incident. He was employed at a gated retirement community in South Florida. Mateen underwent company screening and background checks when he was recruited in 2007 and the check revealed nothing of concern. His screening was repeated in 2013 with no findings. "We are cooperating fully with all law enforcement authorities, including the FBI, as they conduct their investigations. In 2013, we learned that Mateen had been questioned by the FBI but that the inquiries were subsequently closed. We were not made aware of any alleged connections between Mateen and terrorist activities, and were unaware of any further FBI investigations. Our thoughts and prayers remain with the victims of this unspeakable tragedy, and their friends and families."

Daniel Gilroy, who worked with Mateen at the facility, told Florida Today that he was “unhinged and unstable. He talked of killing people." Gilroy added that he complained to G4S about Mateen’s odd, often bigoted, behavior—to no avail. Eventually, Mateen began stalking Gilroy, leaving him 30 or more text and phone messages per day. Gilroy eventually quit.

G4S has come under scrutiny in Florida in the past few years after some of its guards were found to be abusing children in facilities where the company provides security.

At the Palmetto Youth Academy in Manatee County, G4S employee Leroy Bostic Jr. was arrested in 2014 on charges of sexually abusing two teenage boys.

At a facility in Tampa, G4S employee Viviana Hernandez-Trejo was investigated for engaging in sex acts with a boy under her care.

An investigation in 2015 by Scripps Treasure Coast Newspapers found records documenting multiple assaults at youth-detention facilities G4S managed in Florida, both against the company’s employees as well as minors under its charge. G4S provides security for about 30 juvenile-detention centers in the state of Florida, according to the report.

“I’m amazed at the amount of violence that goes on over there, both against staff and other inmates,” Assistant State Attorney Vicki Nichols, Martin County’s juvenile prosecutor, told the newspaper, referring to a girls’ facility run by G4S that had a history of violent altercations among staff and children.

Around 2 a.m. Sunday, Mateen, armed with an AR-15-style assault rifle and a handgun, entered the Pulse club and began shooting, officials said. After most of the 320 people there escaped, Mateen took hostages from a group that was hiding in a bathroom. Shortly before 6 a.m., a SWAT unit breached the club doors and engaged Mateen in what’s being called a protracted gun battle. Mateen was killed.

The deadliest single-person mass murder in American history before Orlando occured in Bath, Michigan, in 1927, when a man bombed a school, killing 44 people.

—with additional reporting by Nancy A. Youssef

Read more coverage of the massacre at the Pulse nightclub