National Security Adviser H.R. McMaster speaks during a White House briefing Tuesday. (Jabin Botsford/The Washington Post)

When H.R. McMaster first met with his National Security Council staff in the White House this year, he told them that he was as surprised as anyone to be standing there.

The lieutenant general’s plan had been to retire from the Army this year and look for a teaching position at Harvard or Yale, he told his new staff. And he vowed that he was coming to the job of national security adviser with a completely apolitical mind-set. His sole focus as an active-duty military officer was on defending the country, he said.

On Tuesday, McMaster took on a different role: He strode into the White House briefing room to defend an embattled President Trump amid allegations that the latter had revealed highly classified information in a meeting with the Russian foreign minister and ambassador.

“What I am saying is really the premise of that article is false,” McMaster said of The Washington Post’s initial report on the meeting and intelligence disclosure.

For McMaster, who has kept a relatively low public profile since taking the job, the moment marked a critical test.

(Bastien Inzaurralde,Jayne Orenstein,Dalton Bennett,Alice Li,Whitney Leaming/The Washington Post)

Trump chose McMaster to lead the National Security Council following the ouster of his predecessor, Michael Flynn, in part because of McMaster’s reputation for candor over a 33-year career.

In “Dereliction of Duty,” which McMaster wrote as a young officer, he was harshly critical of top Vietnam-era generals for not speaking frankly to the president and in public when they thought the war was going badly. As an Army colonel in northern Iraq overseeing a 5,000-soldier armored cavalry regiment, McMaster was known for his independent streak and willingness to buck a strategy that did not seem to be working.

“The real challenge for McMaster is that he has a lot of credibility, particularly with key constituencies that may not trust President Trump at this point,” said Peter Feaver, former senior official in George W. Bush’s White House. “He can use that credibility to support the president, but if he’s wrong or the president undercuts him, he loses his capacity to serve the president well the next time.”

Privately, senior White House officials said that McMaster has been respectful of Trump, a relative foreign-policy newcomer who has little interest in slogging through thick briefing books.

In Oval Office meetings, senior aides said that McMaster often steers Trump away from counterproductive or impractical ideas by gently suggesting that the National Security Council study them and get back to the president in a few days or weeks.

Publicly, however, McMaster often faces a tougher challenge in a new role that he probably still is learning to manage, said some of the general’s former colleagues and friends.

All military generals serve at the president’s discretion and in that sense are political appointees. “But the national security adviser is a political appointee in a much broader sense,” Feaver said. “He should be privy to every meeting that the president has touching on foreign policy.”

(Video: Reuters)

In addition to helping the president develop and execute foreign policy, McMaster’s job includes helping sell the president’s plans to the American people. When controversy erupts, the national security adviser is expected to shield the president. “Your job is to take incoming fire to try to protect the boss,” said Derek Chollet, a senior national security official in the Obama administration. “Ideally that’s because the president has made a very tough decision, and you have to defend it. This strikes me as more of a cleanup exercise.”

The last week has forced McMaster to play both of those roles — somewhat uncomfortably. On Friday, he appeared before reporters in the White House briefing room to outline the president’s first big foreign trip.

The general dodged questions about Trump’s controversial decision to fire FBI director James B. Comey and defended the president’s sometimes rough treatment of allies.

He also finessed an earlier disagreement with Trump over the phrase “radical Islamic terrorism,” which the president has used to describe the threat posed by extremist groups throughout the Middle East and South Asia. McMaster has privately and unsuccessfully urged the president to jettison the label as too broad.

Under the spotlight, McMaster seemed to settle on a compromise. He said Trump on his upcoming trip to Saudi Arabia would relay a “strong, respectful message” that urges the United States’ Muslim allies to take a stand against a “radical Islamist ideology that uses a perverted interpretation of Islam to justify crimes against all humanity.”

As the controversy over Trump’s revelations to the Russians exploded Monday, McMaster initially avoided the press. “This is the last place in the world I wanted to be,” he cracked when he accidentally bumped into a scrum of reporters outside of the White House press secretary’s office.

Later that evening, he delivered a terse statement supporting the president, calling The Post’s initial story “false.”

By Tuesday, McMaster was back in front of reporters in the White House. This time he did not dispute the story’s central facts. He declined to say whether Trump had shared sensitive intelligence with the Russians and speculated that calls from the White House to intelligence agencies to mitigate damage from the revelations were made out of “an overabundance of precaution.”

“None of us felt in any way the conversation was inappropriate,” he said of Trump’s meeting with the Russian foreign minister and ambassador.

For McMaster, the public appearances this week are especially fraught. Unlike his short-lived predecessor in the job, McMaster does not have a long relationship with Trump. Recently some senior administration officials have complained that McMaster’s push to send more U.S. troops to Afghanistan is a betrayal of the nationalist foreign policy that Trump outlined on the campaign trail.

The biggest burden for McMaster, though, may be own words as captured in “Dereliction of Duty.” “The president was lying, and he expected the Chiefs to lie as well or, at least, to withhold the whole truth,” McMaster wrote in the book’s epilogue, referring to the Joint Chiefs of Staff. “Although the president should not have placed the Chiefs in that position, the flag officers should not have tolerated it when they had.”

To some in Washington, McMaster failed that test this week. Eliot A. Cohen, a senior official in the George W. Bush administration and Trump critic, accused McMaster in an essay for the Atlantic magazine of peddling “parsed half truths that are as bad, and in some cases worse” than lies.

Others defended McMaster as making the best of a tough situation.

“Let’s say the president misspoke or went too far,” Feaver said, “then part of his job is damage control.”