Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Investigators probing gunman Omar Mateen's massacre at least 49 people at a popular gay nightclub in Florida are trying to determine whether terrorism, homophobia or both pushed him over the edge.

Noor Mateen and husband Omar Mateen are seen in a Facebook profile photo. via Facebook

A few key revelations about his past came to light hours after the 29-year-old was identified as the shooter who took hostages at the Pulse nightclub in Orlando early Sunday.

He was subsequently killed by a SWAT team.

An ex-co-worker told NBC News that Mateen was racist, belligerent and "toxic."

His father told NBC News his son was enraged after recently seeing a same-sex couple kissing in front of his family, an event that could have set him off.

In 2013, Mateen was interviewed twice by federal agents after co-workers reported that he made "inflammatory" comments to them about radical Islamic propaganda. The following year, the FBI looked at him again because of ties with an American who traveled to the Middle East to become a suicide bomber.

Law enforcement sources told NBC News he swore allegiance to the leader of ISIS, Abu Bakr al-Baghdadi, in a 911 call moments before the rampage at Pulse.

There's no indication that Mateen was in touch with terrorists overseas or that the attack was directed by someone else, a law enforcement officials told NBC News. Nor is there evidence that anyone helped or encouraged him, several officials said.

Investigators are looking into whether religious extremism motivated the attack.

Mateen, who lived roughly two hours south of Orlando in Fort Pierce, worked as a security guard.

Daniel Gilroy, a co-worker at G4S Secure Solutions — formerly known as Wackenhut — told NBC News that Mateen was a "very conscientious" employee who was often early for work and was fascinated by law enforcement.

He was also loud, "very excitable" and racist, Gilroy said.

"He was scary in a concerning way," he said. "And it wasn't at times. It was all the time. He had anger management issues. Something would set him off, but the things that would set him off were always women, race or religion. [Those were] his button pushers."

Working with Mateen was so difficult that Gilroy said he requested a transfer.

Photos: Gunman Opens Fire at Orlando Nightclub

"I needed to be out of that situation," he said. "I described it as being toxic."

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

Mateen "always referred to every other race, religion, gender in a derogatory way," Gilroy added. "He did not like black people at all. That was mentioned once or twice, but more so was women. He did not like women at all. He did like women in a sexual way, but he did not respect them."

His father told NBC News that his son was affected by a recent incident involving two men showing each other affection.

"We were in downtown Miami, Bayside, people were playing music. And he saw two men kissing each other in front of his wife and kid, and he got very angry," Mateen's father, Seddique Mir Mateen, said Sunday. "They were kissing each other and touching each other, and he said: 'Look at that. In front of my son, they are doing that.' And then we were in the men's bathroom, and men were kissing each other."

"We are saying we are apologizing for the whole incident," the elder Mateen said. "We weren't aware of any action he is taking. We are in shock like the whole country."

He added: "This had nothing to do with religion."

Driving the point home that religion was a consideration in the mind of investigators, officials brought a member of the Muslim community to speak at a news conference.

Mateen didn't appear to have any direct ties with ISIS, sources said, although he was a follower of ISIS propaganda and referred to the Tsarnaev brothers, who carried out the Boston Marathon bombings in 2013, at the scene of the shooting.

But while law enforcement delves into what may have radicalized Mateen, who was born in New York and lived in Florida for at least the past decade, his family believes he was fueled by pure hate against the LGBT community.

Related: Obama Condemns Orlando Massacre as 'Act of Terror'

Police did not explicitly say Mateen was Muslim, but Islamic groups put out statements denouncing the carnage.

"We condemn this monstrous attack and offer our heartfelt condolences to the families and loved ones of all those killed or injured. The Muslim community joins our fellow Americans in repudiating anyone or any group that would claim to justify or excuse such an appalling act of violence," Rasha Mubarak, Orlando regional coordinator for the Council on American-Islamic Relations, said in a statement.

Seddique Mir Mateen said his son was a husband and father to a 3-year-old son. He worked in security and attended Indian River State College. A spokeswoman said he got an associate of science degree in criminal justice technology in 2006.

Police say he used a handgun and AR-15-type rifle in the shooting spree.

The U.S. Bureau of Alcohol, Tobacco, Firearms and Explosives officials tweeted Sunday that Mateen legally bought the firearms within the last week.

Records also show that he had filed a petition for a name change in 2006 from Omar Mir Seddique to Omar Mir Seddique Mateen.

His ex-wife, Sitora Yusufiy, who lives in Colorado, told reporters that Mateen was prone to violent behavior and beat her.

Besides abusing her physically, he also isolated her from her family, who worked to persuade her to leave the marriage, she said.

"When he got in his tempers, he would express hate toward everything," Yusufiy said.

The marriage lasted only months, but during that time she never noticed him becoming radicalized.

Still, she lived in fear. Her parents came to take her away and the couple officially divorced in 2011.

Rep. Alan Grayson, D-Florida, whose district includes the area of the massacre, suggested to reporters that "more likely than not" the shooting spree at the nightclub was ideologically motivated.

Omar Mateen in an image from MySpace. MySpace

"Let me put it this way," he said, "the nationality of family members is indicative."

Desiree Mufson, a family friend, told NBC News that Mateen's parents have always been "very respectful" of America and that the idea that someone in the family would unleash terror is surprising.

"They are a beautiful close-knit-loving family and they have no hate for anyone and they are upset as anyone about what happened and feel for the victims," Mufson said.

She added: "Their son went awry."

Editor's note: An earlier version of this article said the gunman killed at least 50 people. Authorities have since said that there were 49 shooting victims, plus the gunman.