The inflammatory pundit Sebastian Gorka worked for the FBI while he was a paid consultant to Donald Trump’s 2016 campaign, lecturing bureau employees on counterterrorism issues.

Until the FBI terminated Gorka for his over-the-top Islamophobic rhetoric.

The Daily Beast has learned that the Federal Bureau of Investigation ended its contract with Gorka just months before he joined the White House as a senior adviser to President Trump.

Law-enforcement officials attending an August 2016 lecture from Gorka, whose academic credentials and affiliation with a pro-Nazi group have recently come under fire, were disturbed to hear a diatribe against Muslims passed off as instruction on the fundamentals of counterterrorism.

Gorka told attendees at the Joint Terrorism Operations Course, an introductory-level class for participants in the FBI’s Joint Terrorism Task Force, that all Muslims adhere to Sharia law, which he said is in conflict with the U.S. Constitution and American democratic values. Officials familiar with his lecture said Gorka taught law-enforcement officials there is no such thing as mainstream Muslims—only those radicalized and those soon to be radicalized.

The following month, a senior FBI official assured outraged and embarrassed colleagues that the bureau would no longer use Gorka for any subsequent lectures or instructions, according to documents reviewed by The Daily Beast.

Bin Laden as “the Martin Luther of Islam”

The controversial address was in line with Gorka’s longtime themes that tend to see the fight against terrorism in religious terms.

In a February 2012 speech to the Westminster Institute think tank, Gorka said Osama bin Laden could be considered “the Martin Luther of Islam,” as both figures believed themselves to take their religions back to their foundations to cleanse them of supposed corruption: “What did bin Laden, or his mentor, Abdullah Azzam, say? Exactly the same thing as Martin Luther, but for Islam: Islam has become corrupted and must return to its roots, to what the jihadis say is the age of the four righteous caliphs.”

Gorka saw little difference between violence and nonviolence in an all-out assault against America.

“If you boil this down to its operational essence,” Gorka said in 2012, “this is about anybody in that camp who wishes to undermine the U.S. Constitution, whether by killing 3,000 civilians in 102 minutes on a beautiful Tuesday morning in New York or by instigating Sharia-compliant mortgages in 26 states in this great nation. Both of those things are a form of attack.”

By then, Gorka was already doing work for the bureau. According to The Wall Street Journal, Gorka’s company received $103,000 from the FBI for training materials between 2012 and 2016. While he was still lecturing for the FBI, the Trump campaign paid him $8,000 for consultations in 2015.

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.

Even as the FBI drummed Gorka out of the Quantico course, Trump continued to embrace him. Gorka was a leading supporter of the mogul’s presidential campaign, praising the candidate during his carousel of Fox News appearances. He shared a dark outlook on Islam with retired Army Lt. Gen. Mike Flynn, a prominent campaign surrogate who went on to become Trump’s first national security adviser.

After Trump’s election, word circulated of the FBI’s investigation of the campaign’s ties to Russia, prompting Trump’s drumbeat of Twitter-borne attacks on the U.S. intelligence community generally and the FBI in particular. Meanwhile, Gorka, a former Breitbart national-security editor when White House strategist Steve Bannon ran the website, joined the transition and then the White House, where he serves as deputy assistant to the president.

After Trump fired FBI Director James Comey, some within the bureau began to wonder if Gorka’s hard feelings contributed to a White House atmosphere of distrust for the FBI.

“This might be a way for Gorka to get back at the FBI for firing him,” a senior FBI official told The Daily Beast.

The Death Star

The FBI has long had a problem with fringe and Islamophobic pseudo-scholars making their way into the bureau’s training on counterterrorism. Gorka’s presentation occurred five years after instructions from Barack Obama’s White House to get rid of the bigoted presentations.

FBI training materials, as recently as 2011, instructed junior counterterrorism agents that Islam itself and “mainstream” Muslims posed a threat to the United States. Quantico PowerPoint presentations asserted a correlation between Islamic devoutness and propensity to violence and dismissed charitable contributions as a pretext for funding terror.

“There may not be a ‘radical’ threat as much as it is a simply normal assertion of the orthodox ideology,” insisted a typical presentation. Another, available on the FBI intranet, portrayed the influx of Muslims into a non-Muslim country as a conquest that would progress from “grievance manufacturing” to “state-run ethnic cleansing” to, finally, “peace” under an Islamic banner.

Once these materials were exposed, Obama’s White House ordered them removed. The FBI even brought in actual experts, from the highly respected Combating Terrorism Center hosted by the U.S. Military Academy at West Point, to aid them in tightening up its training. Ever since, right-wing fringe elements have considered the overhaul a capitulation to the monster it calls “radical Islam.” That chorus includes Gorka, who said in a May 2017 speech that it was “prohibited” within the federal government to discuss the religiously resonant themes ISIS plays upon.

“I can tell you because I was at those academies. I was teaching the FBI and I was a hostage to those politically correct policies of the Obama administration. That has ended,” Gorka boasted.

But the Islamophobic material and its advocates have proven durable within the bureau.

A case in point is William Gawthrop. Gawthrop, an FBI intelligence analyst, led the Islamophobic 2011 Quantico training. In a presentation for FBI partners, Gawthrop even compared Islam to the Death Star from Star Wars.

According to a late 2012 internal investigation into Islamophobia at the FBI, seen by The Daily Beast, an FBI special agent tasked with reviewing Gawthrop’s training materials stated that Gawthrop initially wanted to include a warning against trusting Muslims, even those within the FBI. “A Muslim employee’s loyalties will always lie first and foremost with Islam,” the agent recalled Gawthrop asserting, “and therefore, you should not trust a Muslim coworker.” Yet Gawthrop remains a senior FBI intelligence analyst, based in El Paso.

Gorka’s ‘Holy War’

Gorka, whose lectures also survived the supposed FBI “purge,” has said in his speeches and writings that the U.S. is not “at war with a religion.” Outside of that, he frequently portrays Islam in the direst of terms; conflates terrorist groups, even those that clash with one another, within a single ideological banner; and misstates basic facts about counterterrorism.

In a 2014 speech to the John F. Kennedy Special Warfare Center and School at the U.S. Army’s Fort Bragg, Gorka referenced a book by a Pakistani general to suggest that America is now in a “holy war” with jihadis.

“For Gen. Malik, his patrons, and his acolytes, jihad is clearly a holy war for both sides of the engagement. When jihadist[s] say they are fighting a holy war, the conventional wisdom in the West is just to say that is their distortion. But if our enemy is aiming at our faith system, if they are aiming at our souls, it is a de facto holy war on our side, as well, because our faith is what the enemy has chosen to destroy,” Gorka said in 2014.

Two years earlier, in his Westminster Institute speech, Gorka alleged that Muslim social services within the U.S. are a cover for jihadis to undermine the American social fabric: “What we have seen over the past 10 years on the jihadi web blogs [sic] is that the bad guys are learning and understand that it is not about frontal assaults and big symbolic acts of violence; it is about building a base, providing services, and providing Sharia-compliant mortgages in places like northern Virginia, ‘cultural centers’ in Minnesota. The enemy is learning.”

It’s a consistent theme for Gorka. “The enemy is using religion. We cannot defeat them unless we understand how religion informs their operations, and how they define their strategies, their tactics, their procedures, and their techniques,” he said in a 2016 Budapest speech. Differences between jihadi groups are superficial, as they “all feed from the same genetic code. What is that genetic code? The jihadi ideology of the brotherhood”—despite, say, Hezbollah fighting ISIS or ISIS’ intense campaign to delegitimize al Qaeda.

Despite his claims to expertise, Gorka’s frequent television appearances and lectures often outpace his command of basic facts about his chosen field.

During a January appearance on Fox News, he claimed about the Guantanamo Bay detention center: “Gitmo isn’t a detention facility. Gitmo is an intelligence asset. That’s how we found out where bin Laden was, through interrogations of KSM.” Even if the Khalid Sheikh Mohammed interrogations had led to bin Laden—a claim debunked by the 2014 Senate torture report—those brutal interrogations took place in CIA black sites years before KSM arrived at Guantanamo in September 2006.

The next month, Gorka asserted as fact a “30 if not more than 40 percent recidivism rate from the people released at Gitmo.” The actual rate of confirmed recidivism, according to a March report from the director of national intelligence, is 16.9 percent. In his May speech, Gorka repeatedly dated the birth of ISIS’ “caliphate” as June 29, 2015, which is a year late. (For good measure in that speech, Gorka also said, “You couldn’t negotiate with Brezhnev,” which would come as a surprise to Richard Nixon.)

Even when Gorka makes a point shared by rigorous counterterrorism scholars, he tends to misapprehend it. In late November 2016, Gorka reacted to a Muslim student’s knife attack at Ohio State University by listing a variety of unrelated recent attacks and asserting: “These are all people linked together… by the connective tissue of jihadi ideology.” Counterterrorism analysts have recently rethought the concept of “lone wolf” attackers, but not because of any banal ideological confluence—which would link Trump to every #MAGA supporter who tweets a racist or anti-Semitic meme—but because several have actual operational links to ISIS.

“Sebastian Gorka was better known as an ideologue than an objective terrorism researcher when the FBI hired him, which raises a question whether its goal was to promote flawed notions about ‘radical Islam’ within law enforcement rather than to provide reliable scholarly research that could be used to make all American communities safer,” said former FBI agent Mike German.

“The FBI promised to strengthen its counterterrorism training by properly vetting its instructors after a previous era of biased anti-Muslim training. If Gorka is the type of instructor the FBI selects for these assignments under its new protocols, it shouldn’t be surprising that Muslims remain a target of inappropriate law-enforcement attention.”

“Dr. Gorka”

In internal documents about the Gorka episode last fall, the FBI refers to him as “Dr. Gorka,” an honorific he prominently features on the cover of his book Defeating Jihad. But University of North Carolina Prof. Andrew Reynolds picked apart Gorka’s academic credentials in Haaretz, judging his Ph.D. “about as legitimate as if he had been awarded it by Trump University.” More disturbingly, a Forward series found members of the Hungarian extremist group Vitezi Rend that was formed to support Hitler’s anti-Semitic ally Miklos Horthy in World War II who say Gorka is a sworn member. Gorka’s explanation for his membership is that he merely seeks to honor his anti-communist émigré father.

It is unclear if Gorka held a security clearance for his FBI lectures. BuzzFeed News reported that he was denied one in 2002 by the Hungarian parliament when he sought work on an investigative committee. As of February, Reuters had reported Gorka lacked sufficient clearance to work on security issues at the White House.

The FBI declined comment for this story. Neither Gorka nor the White House responded to questions or a request for comment by press time.

Gorka, now a deputy assistant to Trump, told the Journal that he had reviewed Trump’s travel ban from majority-Muslim countries before its issuance in January. But now he appears to be in eclipse in the White House.

He is widely distrusted by the National Security Council, according to three Trump NSC veterans. Shortly before Trump fired Flynn, the NSC’s similarly distrusted chief, Gorka praised Flynn’s “sterling leadership.” The policy entity on which Gorka served as foreign-policy chief, ex-Breitbart chief Bannon’s Strategic Initiatives Group, has petered into nonexistence. Trump, aides have told The Daily Beast, keeps Gorka around to be a combative television surrogate. Along with Gorka’s former Breitbart employer, Steve Bannon, Trump personally stepped in to save Gorka’s White House job after his various controversies.

Gorka’s wife, Katharine, remains an official at the Department of Homeland Security. After his final FBI lecture, sources familiar with it say, Gorka recommended that the law-enforcement officers buy her book.