Retired Army Lt. Gen. Michael Flynn was fired from his last job in the military, sat next to Russian President Vladimir Putin after giving a paid speech in Moscow, called for Hillary Clinton to be imprisoned, and said President Obama was a “liar” with no plan for defeating ISIS.

As of Thursday, there’s something new to say about him: Flynn will be moving into the West Wing as President-elect Donald Trump’s national security adviser.

The move will immediately make Flynn one of the most powerful people in the US government and give him enormous influence over the Pentagon, State Department, and CIA — the very organizations he clashed with publicly and privately during his final years in uniform.

Flynn has effectively been carrying out many of the duties of that role during the transition, sitting in with Trump for highly-classified intelligence briefings and working — along with Trump’s son-in-law Jared Kushner — to fill key national security positions. NBC News reported that Flynn personally vetoed candidates like retired Adm. William McRaven, retired Marine Corps Gen. James Mattis, and former House Intelligence Committee Chairman Mike Rogers.

Flynn had also been considered for defense secretary, but his new appointment as national security adviser, which doesn’t require congressional approval, allows Trump to sidestep what would have likely been a bruising, two-step confirmation battle on Capitol Hill.

Flynn, who ran the Defense Intelligence Agency until retiring in 2014, would have first needed a congressional waiver to get around rules requiring former military officers to be out of uniform for seven years before taking the top post at the Pentagon. He’d then have needed to win the approval of at least 51 lawmakers. Even with the Senate in Republican control, that wouldn’t have been a sure thing.

Democrats would have lashed into Flynn because he broke with the longstanding tradition of retired officers avoiding direct criticism of presidents they had served. Republicans would have pressed Flynn about Trump’s stated Russia policy, which is predicated on building closer ties with Putin despite the Russian strongman’s human rights violations and annexation of Crimea.

Republican lawmakers would also likely have grilled Flynn about his decision to do a paid series of events in Moscow that included a speech and an appearance at an anniversary party for RT, a Kremlin-funded TV station, where he was photographed sitting next to Putin.

Putting Flynn in the White House means Trump can avoid having to watch one of his closest advisers face such difficult and potentially embarrassing questions. But it raises a pair of much more fundamental ones: How will Flynn use his new power, and where does he want to take the US?

A retired military officer who sounds just like Donald Trump

Flynn isn’t the first retired officer to endorse a presidential candidate. One of his contemporaries, former Marine Corps Gen. John Allen, spoke in favor of Hillary Clinton at the Democratic National Convention in Philadelphia. Flynn, though, has gone far, far beyond that.

At a campaign rally in Florida in August, Flynn quite literally likened Clinton to the adversaries he spent 33 years fighting on the battlefield.

“The enemy camp in this case is Hillary Rodham Clinton,” he said, according to a lengthy profile in the Washington Post this summer. “This is a person who does not know the difference between a lie and the truth. . . . She is somebody who will leave Americans behind on the battlefield.”

He went further at the Republican convention in Cleveland, saying the US didn’t need a “reckless president who believes she is above the law” and clapping as the crowd began to chant, “Lock her up!” Flynn made it clear that he felt much the same way. “You’re damn right!” he said.

The tenor of Flynn’s comments has startled other retired officers. Retired Army Gen. Stanley McChrystal, the top commander in Afghanistan when Flynn was running intelligence operations there, reached out to Flynn to urge him to tone down his rhetoric, according to a source familiar with the conversation. Retired Adm. Mike Mullen, the former head of the Joint Chiefs of Staff, conveyed a similar message, according to the Washington Post. Two other retired officers told me in separate interviews that they considered Flynn to be “unhinged.” Flynn ignored the advice to rein himself in, and if anything, became even more partisan.

Flynn’s anti-Clinton rhetoric isn’t the only area where he has used used language that echoes that of his new boss. Trump has called for banning Muslims from entering the US, talked of closing down mosques, falsely claimed Muslims were seen celebrating the 9/11 attacks, and said Muslims needed to police their own communities for signs of militants in their midst. Flynn, for his part, tweeted in February that “fear of Muslims is RATIONAL,” leading the Council on American-Islamic Relations to issue a statement Thursday urging Trump to replace Flynn with “another candidate who does not hold such bigoted views.”

Flynn, who did multiple tours in Iraq and Afghanistan, has also adopted some of Trump’s core foreign policy positions, including the president-elect’s beliefs that ISIS poses the biggest threat to the US and that the military needs to take a far more aggressive approach to fighting the group.

That’s starkly different from the viewpoints of the serving generals Flynn will now help to oversee, who generally support the Obama administration’s current strategy of bombing ISIS from the air while arming and training local forces battling on the ground. They also think Russia, not ISIS, is the biggest threat to the US.

During his July 9 2015 confirmation hearing to be the next chairman of the Joint Chiefs of Staff, Marine Corps Gen. Joseph Dunford Jr. said, “Russia presents the greatest threat to our national security” and “could pose an existential threat to the United States.” ISIS was fourth on his list, behind China and North Korea.

ISIS was even lower down the list of Dunford’s deputy, Air Force Gen. Paul Selva, who told lawmakers at the time that he “would put the threats to this nation in the following order: Russia, China, Iran, North Korea, and all of the organizations that have grown around ideology that was articulated by al-Qaeda.”

“Right now, [the Islamic State] does not present a clear and present threat to our homeland and to our nation,” Selva said, adding that Russia’s powerful armed forces could become an “existential threat to this country.”

Given his newfound power, Flynn could help Trump brush aside those concerns in favor of doubling down on what the military’s top brass see as the wrong war and cozying up to the country many military leaders see as our greatest threat.

Flynn could also work to reshape US policy towards Turkey and its increasingly autocratic and Islamist president, Recep Tayyip Erdogan. In the wake of a failed coup earlier this year, Erdogan has jailed tens of thousands of journalists, soldiers, police officers, academics, politicians, and human rights advocates. He has also pressed Washington to extradite the Muslim cleric he blames for the coup, Fethullah Gülen, who has lived in self-imposed exile in Pennsylvania since 1999.

The Obama administration has refused to do so, noting that Ankara has yet to present concrete evidence of links between Gülen and the coup plotters and couldn’t ensure he would get a fair trial. Flynn, however, has said the cleric should be sent back to Turkey regardless of what happens to him once he’s there.

“The forces of radical Islam derive their ideology from radical clerics like Gülen, who is running a scam,” Flynn wrote in an op-ed in The Hill. “We should not provide him safe haven. In this crisis, it is imperative that we remember who our real friends are.”

Flynn himself has his share of admirers, including several who worked for him at various stages of Flynn’s career and describe him as the rare officer willing to speak to power without regard for what that would do to his chances at promotion.

In 2010, for instance, Flynn co-wrote a paper blasting the ways the US military was gathering intelligence in Afghanistan. The Pentagon’s existing systems, Flynn and his co-authors wrote, were “unable to answer fundamental questions about the environment in which U.S. and allied forces operate and the people they seek to persuade.” The paper didn’t, to put it mildly, boost Flynn’s popularity within the Pentagon.

But Flynn has an equally long list of detractors, and his role in the White House means he will have the muscle to force them from their current jobs or ensure they don’t get new ones. To get a sense of why so many dislike him so strongly, you need to go back to Flynn’s last job in the military.

A spy at war with the nation’s other spies

Colin Powell wasn’t pulling punches.

“I spoke at DIA last month,” the former secretary of state wrote in a hacked email released this summer. “Flynn got fired as head of DIA. His replacement is a black Marine 3-star. I asked why Flynn got fired. Abusive with staff, didn’t listen, worked against policy, bad management, etc. He has been and was right-wing nutty every [sic] since.”

Those who know Flynn best say the roots of his enmity towards Obama and Clinton —and his startlingly enthusiastic embrace of Trump — dates back to his abrupt dismissal from the DIA, the Pentagon’s intelligence-gathering arm and a longtime bureaucratic rival to the CIA.

In 2012, Flynn proposed overhauling the agency so it would maintain a network of covert operatives to expand its network of overseas spies, according to a long article I co-wrote in Foreign Policy about the fight. The move infuriated the CIA, which worked hard to stop the creation of what could have ultimately come to rival its larger and better-known cadre of covert operatives. The agency, backed by a network of former CIA personnel in senior jobs at the Pentagon and elsewhere in the national security bureaucracy, succeeded in killing the idea.

In 2014, two years into what was supposed to be a three-year term, Flynn was summoned to the Pentagon by Director of National Intelligence James Clapper and then-Undersecretary of Defense for Intelligence Michael Vickers and told that he was being removed from his post.

According to the Washington Post, Flynn tried to salvage his job by sidestepping his superior officers and making a direct appeal to the vice chief of the Army. When Clapper found out, he warned Flynn that he would fire him on the spot if Flynn made another attempt to do an end-run around his bosses, according to the newspaper.

Clapper, arguably Flynn’s biggest bureaucratic adversary, announced his resignation Thursday, just hours before Flynn’s appointment.