Other officials have also remained in close orbit around Trump, in part by lavishing frequent praise on the president both publicly and privately. Trump has remained fond of hard-charging Budget Director Mick Mulvaney, praising his combative briefings with the press. Treasury Secretary Steven Mnuchin and Ross, despite his mocked TV appearance, also have largely remained in Trump’s good graces. The president attended Mnuchin’s Washington wedding last year and the treasury secretary has become a regular on the Sunday talk shows.

Administration officials believe the Cabinet member who has been most successful in managing Trump has been Mattis. The retired Marine general, thought of as a warrior monk for his academic mindset, is soft-spoken in his interactions with the president — often passing up the chance to speak in meetings — but his advice carries outsized weight.

Mattis is a frequent guest at White House lunches and dinners, a sign of his elevated status. He frames his suggestions to the president in terms of his expertise, and when Trump is leaning in a different direction calmly makes his case. White House officials have noticed that Trump sometimes later repeats historical military anecdotes that Mattis related to him — evidence the president was really listening.