The FBI terminated its contract with Sebastian Gorka, who is now a deputy adviser to President Donald Trump, over his inflammatory and often factually incorrect diatribes about Islam during counterterrorism training courses, the Daily Beast’s Spencer Ackerman reported Thursday.

His lectures at the Joint Terrorism Operations Course, an introductory-level class for trainees in the FBI’s Joint Terrorism Task Force, promoted anti-Muslim notions he’s been pushing for years. U.S. law enforcement officials who spoke to the publication said that attendees at the courses Gorka taught were aghast to hear him tell entry-level recruits that all Muslims adhere to Sharia law and are at risk of becoming radicalized.

According to Ackerman, who has previously reported on the FBI’s pattern of using anti-Islam lecturers and training materials, one lecture Gorka presented in Aug. 2016 ultimately prompted the FBI to cut ties a month later:

Attendees of the Joint Terrorism Operations Course include FBI partners from around the country, including the Drug Enforcement Administration, U.S. Marshals, Secret Service, Department of Homeland Security, and sheriffs and major police departments nationwide. The course occurs at the the FBI’s training complex in Quantico, Virginia. FBI officials considered Gorka’s August lecture risible, counterproductive to actual counterterrorism, and an embarrassment to the FBI’s professionalism. Sources said Gorka made the bureau look ignorant in front of the law-enforcement entities it relies on to bolster domestic counterterrorism efforts.

At the time, Gorka was also working as a paid consultant to Trump’s campaign and the national security editor for the far-right Breitbart News. He now serves as a White House counterterrorism adviser, where he has come under fire for his ties to a Hungarian group founded by a Nazi collaborator.

According to previous reporting by the Wall Street Journal, the FBI paid Gorka’s company $103,000 for training materials between 2012-2016.

Counterterrorism experts previously interviewed by TPM had little familiarity with Gorka’s work, except for his strident anti-Islam views. As they noted, the author of “Defeating Jihad” does not speak Arabic and his TV appearances and blog posts often recycle the same themes about the threat of “radical Islam” and the need to profile Muslims living in the U.S.

He now circulates these ideas from his post inside the White House, though reports have painted him as a relatively powerless adviser because he lacks the appropriate security clearance to sit in on top-level national security meetings.