In choosing Lt. Gen. H.R. McMaster as his national security adviser, President Trump has made his most imaginative decision to date. Now we will see whether he and his inner circle let McMaster do the job.

McMaster is widely viewed as the Army’s smartest officer. His service in Iraq and Afghanistan as a regiment commander and staff adviser drew justifiably high acclaim. But he has spent little time in Washington and has had no experience even participating in interagency meetings, much less running them.

He has strong ties to Secretary of Defense James Mattis, having known him in Iraq when Mattis was a division commander, and, along with Mattis, McMaster will likely resist policies that revive torture or paint Muslim nations with a broad and hostile brush. However, it is unclear what McMaster’s views are on other broad issues of policy, regarding Russia, China, or Israel, for example. Some national security advisers push their views; some coordinate the views of others. McMaster may be more inclined toward the latter approach. If so, it’s worth noting that he has little patience with paperwork and other organizational mundanities, which means he will need an excellent deputy—and that means the current deputy, K.T. McFarland, an incompetent ex–Fox News commentator who had done menial tasks in previous administrations, must go.

Trump’s first choice for national security adviser, retired Vice Adm. Robert Harward, turned down the offer in part because Trump wouldn’t guarantee that he could bring in his own team. Friends of McMaster advised him, going into last weekend’s interviews with Trump, to insist on the right to hire and fire staff, including McFarland. If she and a few others don’t resign in the coming days, it may be an ominous sign that McMaster was given less leeway than he’ll need to do the job right. It may have been awkward, as an active-duty officer, for McMaster to make demands of the commander-in-chief. He will soon learn, in any case, just how much (or little) power he’ll be allowed.

The key thing to know about McMaster—an active-duty three-star general and deputy commander of the Army’s Training and Doctrine Command—is that he has made a career of speaking truth to power, often instinctively, without the slightest talent for fawning to his superiors. He made his first mark with a Ph.D. dissertation, written when he was a major, titled Dereliction of Duty: Lyndon Johnson, Robert McNamara, the Joint Chiefs of Staff, and the Lies That Led to Vietnam. Contrary to conventional Army wisdom in the 1970s and ’80s—which blamed the war’s loss on civilian micromanaging and the media—McMaster lambasted the top U.S. military officers for betraying their constitutional duties by failing to give the president their honest military judgment as the nation plunged into the quagmire of Vietnam.

When the dissertation was published as a book in 1998, a handful of top officers—including, fortunately for McMaster, JCS Chairman Hugh Shelton—admired it and urged all officers to read it and take its lessons to heart. Still, most Army generals viewed McMaster as a troublemaker, and it’s unlikely he would have been promoted past colonel had it not been for an unlikely convergence of events.

Early in the Iraq war, as the invasion drifted into occupation and spawned an insurgency, McMaster was chief adviser to Gen. John Abizaid, head of U.S. Central Command. In that capacity, he compiled—and read—an enormous library of books and articles, many of them long out-of-print, about counterinsurgency warfare. In 2005, McMaster took command of an Army regiment whose 5,200 soldiers were ordered to liberate Tal Afar, a city of a quarter million people that had been taken over by insurgents. Applying the lessons of his books, which emphasized not only combat tactics but also economic development and partnerships with local political leaders, McMaster won the battle and stabilized the city.

Among his traits as a commander that have particular pertinence now was that he ordered his soldiers to treat detainees humanely and not to use derogatory language toward Muslims.

Around the time of McMaster’s Tal Afar triumph, some officers in the Pentagon were beginning to realize the war was going badly. They assembled a “council of colonels” to come up with new ideas on how to win. McMaster’s success made him a natural candidate for the council. He and his fellow colonels delved into the classified files every day for three months and produced a top-secret briefing, the first slide of which read: “We are losing because we are not winning. And we are running out of time.” The report’s recommendations heavily influenced President Bush’s troop surge—and the shift to a counterinsurgency strategy—in early 2007. (It also led Bush to appoint, as the new commander in Iraq, Gen. David Petraeus, who had been counseling McMaster and others behind the scenes all along.)

Even so, the Army promotion board—which consisted of some of the most vapid generals in the service—declined to give McMaster a general’s star. By the time the board was scheduled to meet again, the new civilian secretary of the Army, a former congressman named Peter Geren, instigated a one-man reform. Geren had spent much time listening to Lt. Col. John Nagl, another intellectual Army officer who had fought in Iraq and was now doing staff work in the Pentagon. Nagl particularly complained about the Army’s disastrous promotion board, which rewarded mediocrities and passed over the brightest officers. Nagl pointed in particular to the rejection of Col. McMaster.

The secretary of the Army usually rubber-stamps the names given to him by the deputy chief of staff, but Geren decided to name the members of 2008’s board himself, including Gen. Petraeus as its chairman. It was extremely unusual to call a commanding general home from battle for an administrative task, but Petraeus saw the importance of this job. His board revived the stalled careers of a half-dozen creative officers, including McMaster.

Since then, McMaster has advanced steadily from one-star to two-star to three-star general, mainly in commands that focus on strategy, doctrine, and the future of the Army. Some friends of McMaster say he was mulling retirement—it was unclear whether he’d be promoted to a fourth star—when he got the call to go to Mar-a-Lago.

After Vice Adm. Harward rejected Trump’s offer, reports of other possible candidates were bandied about, most notably Petraeus, who, according to friends, wasn’t keen to take the job either and made a number of demands—concerning his staff, direct access to the president, and lines of authority to the rest of the national-security bureaucracy—that weren’t met. White House officials said Petraeus was no longer in the running when they listed the foursome invited to meet with Trump at his Florida resort over the weekend.

The most famous name on the list was John Bolton, a former Bush official and neoconservative provocateur, whose hawkishness on Iran might have earned Trump’s favor but whose equal hawkishness on Russia might not have. Bolton also has an imperious manner that almost nobody likes and a walrus mustache that probably offended Trump, who is said to despise facial hair. In a disconcerting note, though, Trump said he would ask Bolton “to work with us in a somewhat different capacity,” adding, “We had some real good meetings with him. Knows a lot. He had a good number of ideas that I must tell you I agree very much.”

Another candidate was Lt. Gen. Robert Caslen, the superintendent of West Point.* When his name was announced, a fellow general and a good friend of Caslen’s told me, “Bob is a very nice guy, but just about the last person I would pick” for the job. Another general who also knows Caslen well called him “a very good man but one who might be eaten alive” in the White House, adding that he “does not have deep knowledge of many of the global situations.”

The other candidate was retired Lt. Gen. Keith Kellogg, who was already serving as the National Security Council’s chief of staff and who stepped up as acting national security adviser after Trump asked for retired Lt. Gen. Michael Flynn’s resignation. Kellogg is widely seen as a competent administrator but little more.

It is unusual for active-duty officers to be named the assistant to the president for national security affairs (the full title of the job), though not unprecedented. Then–Lt. Gen. Colin Powell served in that job under President Ronald Reagan. But by that time, Powell was already a consummate operator in Washington, as well as a combat veteran of the Vietnam War. McMaster, a maverick in an army that doesn’t tolerate many mavericks, comes into the job—the most vaunted and least likely in a series of vaunted, unlikely posts for the officer—with the keenest intellect and most rigorous judgment of anyone who’s taken the job in decades. We will soon see whether that’s enough to get by, much less thrive, under Trump and among his circle.

*Correction, Feb. 21, 2017: This article originally misspelled Lt. Gen. Robert Caslen’s last name. (Return.)