After White House Chief of Staff John F. Kelly pressured President Trump last fall to install his top deputy, Kirstjen Nielsen, atop the Department of Homeland Security, the president lost his temper when conservative allies argued that she wasn’t sufficiently hard line on immigration. “You didn’t tell me she was a [expletive] George W. Bush person,” Trump growled.

After Kelly told Fox News Channel’s Bret Baier in a January interview that Trump’s immigration views had not been “fully informed” during the campaign and had since “evolved,” the president berated Kelly in the Oval Office — his shouts so loud they could be heard through the doors.

And less than two weeks ago, Kelly grew so frustrated on the day that Trump fired Veterans Affairs Secretary David Shulkin that Nielsen and Defense Secretary Jim Mattis both tried to calm him and offered pep talks, according to three people with knowledge of the incident.

“I’m out of here, guys,” Kelly said — comments some interpreted as a resignation threat, but according to a senior administration official, he was venting his anger and leaving work an hour or two early to head home.

The recurring and escalating clashes between the president and his chief of staff trace the downward arc of Kelly’s eight months in the White House. Both his credibility and his influence have been severely diminished, administration officials said, a clear decline for the retired four-star Marine Corps general who arrived with a reputation for integrity and a mandate to bring order to a chaotic West Wing.

Kelly neither lurks around the Oval Office nor listens in on as many of the president’s calls, even with foreign leaders. He has not been fully consulted on several recent key personnel decisions. And he has lost the trust and support of some of the staff, as well as angered first lady Melania Trump, who officials said was upset over his sudden dismissal of Johnny McEntee, the president’s 27-year-old personal aide.

“When you lose that power,” said Leon Panetta, a Democratic former White House chief of staff, “you become a virtual White House intern, being told where to go and what to do.”

This portrait of Kelly’s trajectory is based on interviews with 16 administration officials, outside advisers and presidential confidants, many of whom spoke on the condition of anonymity to assess the chief of staff. Kelly declined interview requests.

In large part because of his military credentials, Kelly still commands a level of respect from Trump that sometimes eluded his predecessor, Reince Priebus, whom the president would derisively refer to as “Reincey.” On issues such as national security and immigration, Trump continues to listen to Kelly. And for all the evident chaos, the West Wing now features less knife fighting and dysfunction than in the early months, when Trump set Priebus on coequal footing with then-chief strategist Stephen K. Bannon.

One senior White House official disputed that Kelly’s relationship with Trump has been especially turbulent in recent weeks, noting that the president still talks to Kelly more than any other official. This official explained that Kelly initially viewed his job as babysitting, but now feels less of a need to be omnipresent, while Trump, who once considered Kelly a security blanket, feels increasingly emboldened to act alone.

But inside and outside the White House, Kelly’s credibility has suffered from a string of misstatements, most recently over his management of domestic abuse allegations against former staff secretary Rob Porter and of Trump’s decision to oust Army Lt. Gen. H.R. McMaster as national security adviser. And for all the structure he has brought to the bureaucracy, colleagues still view Kelly as tone deaf in dealing with politics.

Kelly is the latest high-profile example of a West Wing Icarus — swept high into Trump’s orbit, only to be singed and cast low. Nearly everyone who has entered the White House has emerged battered — rendered a punchline (former press secretary Sean Spicer), a Justice Department target (former national security adviser Michael Flynn) or a diminished shell, fired by presidential tweet (former secretary of state Rex Tillerson).

No one knows how many days remain for Kelly, but when he leaves — either by the president’s hand or because of his own mounting frustration — he is almost certain to limp away damaged.

“Everybody in the orbit of Donald Trump gets sucked in and tarnished or destroyed,” said Chris Whipple, author of “The Gatekeepers,” a history of White House chiefs of staff. “Kelly has been tarnished, no doubt about it.”

'How's Kelly doing?'

When Kelly, then the homeland security secretary, was appointed chief of staff late last July, the news was met with enthusiasm. Many Trump watchers hoped Kelly would prove a voice of reason and restraint in an administration often perceived to be teetering out of control. And many West Wing aides similarly welcomed the new discipline, thinking Kelly’s regimen would free them to do their jobs.

Initially, at least, Kelly was successful. He began closing the door to the Oval Office, so aides couldn’t loiter or wander in and out hoping to sway the president on issues outside their purview. He made meetings smaller, which helped reduce leaks to the press and make conversations more efficient. And he limited the number of aides who had Oval Office walk-in privileges to a small group.

“I didn’t know the Oval Office even had a door,” one staffer joked to Kelly, several months after he’d taken over. Kelly, meanwhile, marveled that in the early days staffers sometimes entered still chatting on their cellphones.

Under Kelly’s watch, the president now has “Policy Time,” sessions once or twice a day where advisers present and argue their competing views over a specific issue, with Trump presiding. He has also implemented bimonthly Cabinet meetings, with a focused agenda, as well as restored order to the morning senior staff meeting. And attendance for most Oval Office meetings is still run through Kelly’s office.

But about a month into Kelly’s tenure, Trump began to chafe at the strictures. The president invited staff and Cabinet secretaries into the Oval Office without scheduled appointments and called friends and advisers late at night, without Kelly’s sign-off. An early sign of trouble came when Trump polled confidants about his enforcer: “What do you think of Kelly? How’s Kelly doing?” the president asked.

Kelly was an intimidating presence, confiding to some colleagues that he preferred to be feared rather than loved. Yet he was reluctant to be the bearer of bad news. Enter Nielsen, who centralized power as his enforcer, earning her internal enemies.

Kelly requested that staffers back-brief him when the president violated his processes — for instance, by calling a staffer to demand action after watching a Fox News segment. But several aides said they found Kelly difficult when they retroactively filled him in. He often repeated a version of the same response: “I guess you’re the chief of staff now, so why don’t you handle it?”

There were other signs of tensions, as well. Early on, Kelly convened a video conference with aides who were with Trump on vacation at his golf course in Bedminster, N.J. He was beamed in from Washington but erupted when the audio didn’t work. “This is [expletive] ridiculous,” he said, canceling the meeting and storming out of the room. Aides who had not been aware of his temper were stunned.

Days after the publication of Michael Wolff’s “Fire and Fury” — a devastating portrayal of the West Wing, informed by Wolff’s hours of unsupervised time there — Kelly berated senior staff, saying the book should have never happened. “This place was a [expletive] before I got here,” Kelly fumed.

Though some staffers felt unfairly critiqued, others agreed with his assessment.

During the Porter crisis, Kelly found himself under intense scrutiny for the veracity of his whipsaw statements. He publicly praised Porter and privately urged him to stay. But Kelly later claimed that he had demanded Porter’s resignation just 40 minutes after learning the details of the allegations, which conflicted with the White House’s official account delivered by press secretary Sarah Huckabee Sanders.

Many senior staffers were convinced that Kelly was distorting the facts to try to exonerate himself, though some others say his account was accurate.

In March, Kelly again offered contradictory explanations. He privately told staffers that Trump had decided to oust McMaster. But after The Washington Post reported that Trump had made his decision, Kelly began telling others the opposite — while still maintaining to some Trump advisers that the president’s decision had been made. Some advisers thought that Kelly was using the president to push a personal vendetta against McMaster.

In an off-the-record session with reporters, parts of which later were reported, Kelly also said that when he called Tillerson to let him know he was fired, the secretary of state was on the toilet with “Montezuma’s revenge.” Though White House aides said Kelly was simply joking — and the State Department contested his version of the phone call — many staffers found the comment crude and demeaning.

“At the top, you have someone who consistently does not tell the truth,” said James K. Glassman, the founding executive director of the George W. Bush Institute. “That’s a signal to the people below him that they don’t have to tell the truth either, that this is the way we conduct government — we lie when we have to, we mistreat people when we have to, we humiliate them.”

Irritation and respect

In many ways, the Trump-Kelly alliance was always going to be strained. As a business executive, Trump is flexible and freewheeling, prone to impulse and whim. As a retired general, Kelly is structured and partial to hierarchies and rigor.

As chief of staff, Kelly was thrust into the role of disciplinarian. He faced bitter factions, especially among those whose White House access he had cut off (such as Anthony Scaramucci, whose 11-day run as communications director was ended by Kelly) or curtailed (such as Corey Lewandowski, Trump’s first campaign manager).

Kelly’s tensions with Lewandowski boiled over near the end of February, during a meeting with the president. Kelly entered the Oval Office, saw Lewandowski and griped that Lewandowski had been attacking him on television over the Porter fallout but was unwilling to say it to his face. A blowup ensued, with Trump ordering the two to get along. They left the Oval Office for less heated conversation, then reentered and announced a truce.

Asked about the incident, Lewandowski said only, “I am on President Trump’s team and every person who’s supporting this president, which includes John Kelly, is on the team that I’m on.”

Since last fall, tensions between Kelly and Trump have blossomed in episodic bursts.

In one contentious incident in autumn, when Trump moved to fire Tillerson, Kelly dissuaded him during a heated argument in which he threatened to resign. Trump told Kelly he could keep “his guy,” but soon had his revenge, tweeting “Save your energy Rex” on North Korea.

In fact, Kelly has threatened to resign on multiple occasions — “It’s sort of a weekly event,” one senior White House official quipped — though officials explained his declarations as expressions of momentary frustration. (Axios first reported some details surrounding Kelly’s March resignation threat.)

More recently, Trump has told friends he is eager to stage more energetic, frenzied rallies — yet another realm where he can theoretically slip Kelly’s shackles.

“There has to be a bond here between the chief of staff and the staff and the president, and that fundamental bond has been broken,” said Panetta, also a former defense secretary and CIA director. “When that happens, it’s just a matter of time.”

One Trump adviser said the president “doesn’t like a lot of the stuff he has done. He often gets angry and says, ‘Who does this guy think he is?’ But Kelly has a longer chance of surviving because Trump respects him.”

And there are signs that Kelly is adapting to Trump’s world. Last month, the chief of staff who once fumed about the access given to Wolff carved out time in his schedule for a book interview of his own. For about 30 minutes, Kelly sat down with Fox News personality Jeanine Pirro for her forthcoming tome.