Spotted Friday afternoon outside the West Wing, General McMaster told a reporter, “Everybody has got to leave the White House at some point.” Asked if he was leaving sooner rather than later, he said, “I’m doing my job.” Then he walked inside.

Numerous White House officials said that General McMaster, whose job requires him to negotiate internal disputes among factions within the administration as well as deal directly with foreign officials on delicate topics, is operating with the expectation that every day may be his last.

National security veterans expressed alarm, saying perceptions about the general’s job security would directly affect his ability to speak on behalf of the president when it comes to complicated issues like the North Korea nuclear negotiations. Others said General McMaster’s expected dismissal, along with the anticipated firings of the others, would further devastate White House morale.

“You can imagine how people lower down feel,” said R. Nicholas Burns, a professor at Harvard Kennedy School and a former diplomat who worked for presidents of both parties. “They don’t know what is going to happen from one day to the next. They don’t know if their boss is going to be fired or not. You can’t have an effective government like this. It just won’t work.”

People close to the president said Friday that the numerous reports of the general’s imminent demise — including a Washington Post article on Thursday night — along with the role Mr. Kelly was said to have in pushing for Mr. McMaster’s departure, caused the president to pull back, most likely giving General McMaster a reprieve of several weeks.

Reacting to The Post late Thursday, Mr. Trump initially wanted to issue over-the-top praise of his national security adviser, aides said. But the aides persuaded him not to because of the voluminous reports of their strained relationship.

On Capitol Hill, lawmakers in both parties remained largely silent about the White House churn, though Senator Jeff Flake of Arizona, a Republican who is retiring this year, called General McMaster “a stabilizing force” and expressed concern about his possible departure.