WASHINGTON (NYTIMES) - Back when their relationship was fresh and new, and President Donald Trump still called his defence secretary "Mad Dog" - a nickname James Mattis detests - the wiry retired Marine general often took a dinner break to eat burgers with his boss in the White House residence.
Mattis brought briefing folders with him, aides said, to help explain the military's shared "ready to fight tonight" strategy with South Korea, and why the North Atlantic Treaty Organisation (Nato) has long been viewed as central to protecting the United States.
Using his folksy manner, 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 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 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, 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 Trump was pondering whether he wanted someone running the Pentagon who would be more vocally supportive than Mattis, who is vehemently protective of the US military against perceptions it could be used for political purposes.
White House officials said Mattis had baulked at a number of Trump's requests. That included initially slow-walking the President's order to ban transgender troops from the military and refusing a White House demand to stop family members from accompanying troops deploying to South Korea. The Pentagon worried that doing so could have been seen by North Korea as a precursor to war.
Over the last 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 Trump's decision to withdraw the United States from the Iran nuclear deal has proved effective.
The arrival at the White House earlier this year of Mira Ricardel, a deputy national security adviser with a history of bad blood with Mattis, has coincided with new assertions from the West Wing that the defence secretary may be asked to leave after the midterms.
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 Trump outright. Pentagon officials said Mattis had bent over backward to appear loyal, only to be contradicted by positions the President later staked out. How much longer 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 Mattis is important because he is widely viewed - by foreign allies and adversaries but also by the traditional national security establishment in the United States - as the Cabinet official standing between a mercurial president and global tumult.
"Secretary Mattis is probably one of the most qualified individuals to hold that job," Senator Jack Reed of Rhode Island, the top Democrat on the Senate Armed Services Committee, said in an interview. His departure from the Pentagon, Reed said, "would, first of all, create a disruption in an area where there has been competence and continuity."
But that very sentiment is part of a narrative the President has come to resent.
The one-two punch last week of the Bob Woodward book that quoted Mattis likening 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 Trump's belief that he wants only like-minded loyalists around him. (Mattis has denied comparing his boss to an elementary school student and said he did not write the op-ed.)
Trump, two aides said, wants Mattis to be more like Secretary of State Mike Pompeo, a political supporter of the President. During a televised June 21 Cabinet meeting, held as migrant children were being separated from their parents at the southwestern border, Mattis and Pompeo were a study of contrasts: On the President's left, the defence secretary sat stone-faced; on his right, the secretary of state was chuckling at all of Trump's jokes.
Getting Mattis to abandon the apolitical stand he has clung to his entire life will be next to impossible, his friends and aides said.
Mattis has assiduously avoided the limelight during his tenure because he is fearful, aides said, about being put on the spot by questions that will expose differences with his boss. He has batted down multiple requests from the White House to go on Fox & Friends to praise the President's agenda. And he has appeared before reporters at the podium in the Pentagon press room only a handful of times, giving remarkably few on-the-record one-on-one news media interviews - one of which was with a reporter for a high school newspaper in Washington State who had obtained Mattis' cellphone number.
"Secretary Mattis lives by a code that is part of his DNA," said Captain Jeff Davis, who retired last month from the Navy after serving as a spokesman for Mattis since early in the Trump administration. "He is genetically incapable of lying, and genetically incapable of disloyalty."
That means the defence secretary's only recourse is to stay silent, aides to Mattis said. While he does not want to publicly disagree with his boss, he is also uncomfortable with showering false praise on Trump.
But cracks are showing.
In April, John Bolton became the White House national security adviser, replacing Army Lieutenant-General H.R. McMaster, who was long viewed as a subordinate to Mattis because of his rank as a three-star general compared with the retired Marine general's four stars. Bolton is far more hawkish than either Mattis or McMaster; administration officials said his deputy, Ricardel, actively dislikes the Pentagon chief - a feeling Mattis is believed to return in full.
Ricardel, a former Boeing executive who worked at the Pentagon during the George W. Bush administration, has a reputation for being as combative as Bolton.
As the Trump transition official responsible for Pentagon appointments, Ricardel stopped Mattis from hiring Anne Patterson as undersecretary of defence for policy, one of the department's highest political jobs. Patterson was a career diplomat who served as an ambassador under Presidents Bush, Barack Obama and Bill Clinton, but administration officials said Ricardel suspected Mattis was trying to load up the Pentagon with Democrats and former supporters of Hillary Clinton's 2016 presidential campaign.
(Mattis also tried, unsuccessfully, to hire Michele Flournoy, a Defence Department undersecretary in the Obama administration, as his deputy. "He needed a deputy who wouldn't be struggling every other day about whether they could be part of some of the policies that were likely to take shape," Flournoy told a conference hosted by Politico.)
After a stint at the Commerce Department, Ricardel moved to the White House as Bolton's deputy. Since her arrival, friction has increased between the White House and the Pentagon - along with speculation from West Wing aides that Mattis' star is falling.
For instance, Mattis has recently resisted White House attempts to closely supervise military operations by demanding details about US troops involved in specific raids in Afghanistan and elsewhere.
One American official said the White House had bypassed the Pentagon by getting classified briefings of coming operations directly from the Special Operations task forces, to the frustration of Mattis.
That may seem a small and insular example of bureaucratic gamesmanship. But administration officials said it illustrates the tensions between Mattis and Trump: Either the defence secretary cannot appeal to the President, or he has and Trump is refusing to back him up.
Asked about disagreements between the National Security Council and the Pentagon, Garrett Marquis, a council spokesman, said in an email that "Ambassador Bolton is coordinating and working closely with all national security agencies to provide the president with national security options and guidance." In contrast with McMaster, Bolton recently began attending regular weekly meetings between Mattis and Pompeo. Pentagon officials complain that White House interference has returned to the level of Susan Rice, who as Obama's national security adviser was accused of micromanaging the department's every move.
Mattis has repeatedly been blindsided by his boss this summer.
In June, Trump ordered Mattis to set up a Space Force over the defence secretary's objections that such a move would weigh down an already cumbersome bureaucracy.
In July, the President blew up a Nato summit that Mattis and other national security officials had worked on for months. The Pentagon chief and others saved the final agreement only because they shielded it from the president and urged envoys to complete it before Trump arrived in Brussels.
In August, the President undercut Mattis after a news conference at the Pentagon in which the defence secretary suggested that the US military would resume war games on the Korean Peninsula. The exercises had been suspended - against Mattis' advice - after Trump met with the North Korean leader, Kim Jong Un, in Singapore.
"There is no reason at this time to be spending large amounts of money on joint US-South Korea war games," the President tweeted.
Meanwhile, Mattis has begun questioning the efficacy of Trump's decision to pull out of the Iran nuclear deal - a move that, again, was made against his advice. Mattis has told aides he has yet to see any difference in Iran's behaviour since Trump withdrew the United States from the agreement between world powers and Teheran.
Mattis famously was pushed out of his job as head of US Central Command in 2013 because he was viewed as too much of a hawk on Iran policy during the Obama administration. But now, in the Trump administration, Mattis makes his arguments on Iran from the left of Bolton, Ricardel and the President himself.
For Trump, getting rid of his popular defence secretary would carry a political cost. Mattis is revered by the men and women of the US military. Most of the rest of his fans are people Trump does not care about: Democrats, establishment Republicans and US allies.
But moderate Republicans - whom Trump will need in 2020 - appear to trust Mattis as well, and firing him could hurt the President with that key group.
Trump, at the moment, is publicly standing by his defence secretary.
"He'll stay right there," the President told reporters last week when asked about Mattis' comments in Woodward's book. "We're very happy with him. We're having victories people don't even know about."
As for Mattis, "there's no daylight between the secretary and the President when it comes to the unwavering support of our military," said Dana W. White, the Pentagon press secretary. "It's up to the President of the United States to decide what he wants to do."