The gunman responsible for the deaths of 50 people at a gay night club in Orlando, Florida on Sunday morning had contacted police and talked about the Islamic State terrorist group.

Ronald Hopper, a special agent from the FBI in charge of the investigation, said that Omar Mateen made calls to 911 about the Islamic State movement after the shooting started, according to Nine News.

During the calls, Mateen made mention about pledging allegiance to the Islamic State, as well as the Boston Marathon bombers.

Mateen, a 29-year-old US citizen born to Afghan parents in New York, barged inside the Pulse nightclub at 2 a.m. and proceeded to open fire on all the people in attendance, killing 50 and injuring more than 50 other people.

Mateen, who was armed with a rifle and a handgun, was involved in a shootout with an Orlando Police Department officer who was on duty. He was eventually killed during a shootout with the police after they stormed in three hours after the shooting began, authorities said.

Officials went on to reveal that the attack on Sunday was not the first and only time that Mateen had run-ins with the law.

The FBI was first made aware of him in 2013, when he made seditious remarks to colleagues asserting possible terrorist connections. In 2014, the FBI had interviewed him about having a possible connection with an American suicide bomber.

Later on in the day, Mateen’s ex-wife Sitora Yusufiy said that her husband had abused her physically all throughout their relationship. She also believed that he suffered from a mental illness and was emotionally unstable.

Yusufiy, who met Mateen online seven years ago, said that he was “normal” in the beginning, but then saw his “instability” after they wed. Their relationship took a turn for the worse, and her family had to “rescue” her from him, according to CNN.