WASHINGTON • Back when their relationship was fresh and new, and United States President Donald Trump still called his defence secretary "Mad Dog" - a nickname Mr James Mattis detests - the wiry retired Marine general often took a dinner break to eat burgers with his boss in the White House residence.
Using his folksy manner, Mr Mattis talked the President out of ordering torture against terrorism detainees and persuaded him to send thousands more American troops to Afghanistan - all without igniting the public Twitter castigations that have plagued other national security officials.
But the burger dinners have stopped.
Interviews with more than a dozen White House, congressional and current and former Defence Department officials over the past six weeks paint a portrait of a president who has soured on his defence secretary, weary of unfavourable comparisons to Mr Mattis as the adult in the room, and increasingly concerned that he is a Democrat at heart.
Nearly all the officials, as well as confidants of Mr Mattis, spoke on condition of anonymity to discuss the internal tensions - in some cases, out of fear of losing their jobs.
In the second year of his presidency, Mr Trump has largely tuned out his national security aides as he feels more confident as commander-in-chief, the officials said.
Facing what is likely to be a heated re-election fight once the 2018 midterms are over, aides said Mr Trump was pondering whether he wanted someone running the Pentagon who would be more vocally supportive than Mr Mattis, who is vehemently protective of the US military against perceptions it could be used for political purposes.
For President Donald Trump, getting rid of his popular defence secretary would carry a political cost - Mr James Mattis is revered by the men and women of the US military. But moderate Republicans - whom Mr Trump will need in 2020 - appear to trust Mr Mattis as well, and firing him could hurt the President with that key group.
Over the past four months alone, the President and the defence chief have found themselves at odds over Nato policy, whether to resume large-scale military exercises with South Korea and, privately, whether Mr Trump's decision to withdraw the US from the Iran nuclear deal has proven effective.
The arrival at the White House earlier this year of Ms Mira Ricardel, a deputy national security adviser with a history of bad blood with Mr Mattis, coincided with new assertions from the West Wing that the defence secretary may be asked to leave after the midterms.
Mr Mattis himself is becoming weary, some aides said, of the amount of time spent pushing back against what defence department officials think are capricious whims of an erratic president.
The defence secretary has been careful to not criticise Mr Trump outright.
Pentagon officials said Mr Mattis had bent over backwards to appear loyal, only to be contradicted by positions the President later staked out.
How much longer Mr Mattis can continue to play the loyal Marine has become an open question in the Pentagon's E Ring, home to the Defence Department's top officials.
The fate of Mr Mattis is important because he is widely viewed - by foreign allies and adversaries but also by the traditional national security establishment in the US - as the Cabinet official standing between a mercurial president and global tumult.
The one-two punch two weeks ago of the Bob Woodward book that quoted Mr Mattis likening Mr Trump's intellect to that of a "fifth-or sixth-grader", combined with The New York Times op-ed by an unnamed senior administration official who criticised the President, has fuelled Mr Trump's belief that he wants only like-minded loyalists around him.
Mr Mattis has denied comparing his boss to an elementary school student and said he did not write the op-ed.
For Mr Trump, getting rid of his popular defence secretary would carry a political cost - Mr Mattis is revered by the men and women of the US military.
But moderate Republicans - whom Mr Trump will need in 2020 - appear to trust Mr Mattis as well, and firing him could hurt the President with that key group.
Mr Trump, at the moment, is publicly standing by his defence secretary. "He'll stay right there," the President told reporters two weeks ago when asked about Mr Mattis' comments in Woodward's book.
"We're very happy with him. We're having victories people don't even know about."
As for Mr Mattis, "there's no daylight between the secretary and the President when it comes to the unwavering support of our military", said Pentagon press secretary Dana White. "It's up to the president of the United States to decide what he wants to do."