The father of Omar Mateen—the gunman who killed 49 people and injured dozens more at an Orlando nightclub in June 2016—was an FBI source for years before the deadly rampage and is currently the subject of a criminal investigation, according to explosive new court documents.

The revelations surfaced during the trial of Mateen’s wife, Noor Salman, who prosecutors claim knew about her husband’s plan to attack the Pulse nightclub and did nothing to stop him. The 31-year-old is accused of providing material support to a foreign terrorist organization, obstruction of justice, and aiding and abetting her husband in his attack, but the case against her has unraveled in recent days.

Noor Salman has pleaded not guilty. On Sunday, her lawyers filed a motion to dismiss the case.

Prosecutors sent an email over the weekend claiming Seddique Mateen, the gunman’s father, was a confidential FBI source from January 2005 through June 2016, according to the motion filed by Salman’s defense attorneys.

The documents state the father’s relationship with the FBI precluded a previous investigation into threats made by Omar Mateen in 2013, three years before the Pulse attack.

Coworkers reported to authorities that Mateen made comments about being connected to Al Qaeda, Hezbollah, and the Muslim Brotherhood.

Those threats launched officials into a 10-month probe from May 2013 to March 2014 in a joint federal and local effort, running his name through terrorism databases, scrutinizing his phone records, and watching him from unmarked vehicles, the Los Angeles Times reported. Mateen was tracked daily and interviewed twice. Confidential informants were deployed at least a dozen times, the newspaper reported. FBI Special Agent Juvenal Martin testified in court on Monday that even Mateen's supervisor at his office wore a concealed recording device, the Sentinel reported.

Mateen even provided a written statement admitting he had previously lied to agents, but ultimately authorities determined that he was not a threat and closed the case.

Martin said he considered grooming the younger Mateen as a confidential informant for the bureau after the investigation concluded.

“The government has repeatedly failed to disclose that his father played a significant role in that investigation,” the motion states. “Mateen’s father played a significant role in the FBI’s decision not to seek an indictment from the Justice Department for false statements to the FBI or obstruction of justice against Omar Mateen.”

Mateen’s father is also under investigation for money transfers to Afghanistan and Turkey, after authorities found documents they deemed suspicious in his home in the wake of the Pulse attack, the Orlando Sentinel reported.

“An anonymous tip indicated that Seddique Mateen was seeking to raise $50,000 - $100,000 via a donation drive to contribute towards an attack against the government of Pakistan,” the motion states.

Salman’s lawyers have claimed the new information was revealed too late in the trial to adequately explore whether Seddique Mateen knew of his son’s plans to attack the nightclub on June 12, 2016. They have asked for the case to be thrown out or declared a mistrial, citing evidence-disclosure laws.

The defense was set to begin presenting its case Monday after prosecutors rested last week. Lawyers planned to tell jurors that Mateen’s repeated domestic abuse of Salman resulted in doctors diagnosing her with PTSD, the Sentinel has reported.

In defense attorney Linda Moreno’s opening statements, Salman was described as a “trusting, simple” person with a low IQ.

Just days ago, an FBI agent testified in court that the bureau knew early in the investigation that Salman was never near the Orlando nightclub, despite the prosecution’s claims that she visited the site with her husband. After 17 hours of questioning, Salman signed a statement that claimed she was there in the hours before the shooting, but cellphone tower evidence reportedly showed that scenario was impossible. Salman has been held without bond since January 2017.

The Sentinel reports U.S. District Judge Paul Byron said last week he was “concerned” by the revelation.

“The government was well aware that the defendant never scouted out the Pulse,” said defense attorney Fritz Scheller. “That was a critical part of their argument.”