When John Kelly John Francis KellyMORE was brought in six months ago to be President Trump Donald John TrumpUS reimposes UN sanctions on Iran amid increasing tensions Jeff Flake: Republicans 'should hold the same position' on SCOTUS vacancy as 2016 Trump supporters chant 'Fill that seat' at North Carolina rally MORE’s second chief of staff, his mission was clear: bring order to a White House plagued by infighting and leaks.

The four-star Marine general quickly established a new way of doing business in the West Wing, positioning himself as the chief gatekeeper to Trump.

But in the ensuing months, Kelly’s influence has grown beyond deciding who gets access to the president. Lawmakers say he’s also a force behind the scenes, pushing Trump to stick to his campaign vows — particularly on immigration, his signature campaign issue.

ADVERTISEMENT

Democrats in Congress increasingly see Kelly as working to steer Trump away from an agreement that would protect undocumented immigrants who came to the U.S. as children, the very issue that precipitated the three-day government shutdown.

“I would call this the Kelly shutdown,” Rep. Mark Takano Mark Allan TakanoCongress missed the point when it came to helping veterans During Suicide Prevention Month, Trump needs to do more for troops' mental health The Hill's Coronavirus Report: Fauci says focus should be on pausing reopenings rather than reverting to shutdowns; WHO director pleads for international unity in pandemic response MORE (D-Calif.) said. “He’s a pretty disciplined gatekeeper. I would say he had a big hand, and I believe that Kelly’s leaning fully to the right and is the enforcer on this issue.”

Before becoming chief of staff, Kelly was Trump’s secretary of Homeland Security, where he worked to ramp up immigration enforcement and put in place the controversial travel ban — and he's brought that mindset with him into the White House.

As Trump weighed striking a deal with Democrats on immigration last week, Kelly pushed his boss to demand more concessions.

He told the president a deal offered by a group of Senate negotiators would not be good for his agenda and should be rejected. Shortly thereafter, Trump grew confrontational in a private meeting with lawmakers where he referred to some places sending immigrants to the United States as “shithole countries.”

The influence of staffers like Kelly on Trump’s immigration stance have angered Democrats and some Republicans, who say it’s made it harder to get deal on immigration.

“Their staff has been unreliable to work with on this issue,” Sen. Lindsey Graham Lindsey Olin GrahamMomentum growing among Republicans for Supreme Court vote before Election Day Video of Lindsey Graham arguing against nominating a Supreme Court justice in an election year goes viral Warning signs flash for Lindsey Graham in South Carolina MORE (R-S.C.), who pushed back at Trump’s “shithole” remarks during the White House meeting, told reporters on Capitol Hill. “We need a reliable partner."

Graham said White House policy adviser and vocal immigration hard-liner Stephen Miller was more to blame than Kelly, whom he called “a wonderful man.” Still, he acknowledged that Kelly, like other members of Trump’s team, has a “tough position” on the issue.

The shutdown fight also underlined the internal dangers facing Kelly, who risks falling out of favor with the president — much like former White House chief strategist Stephen Bannon — if he is portrayed in the press as a puppet master pulling Trump’s strings.

Kelly angered Trump by telling Democrats during immigration talks on Capitol Hill that the president’s campaign promises were “uninformed” and by publicly saying that Trump’s position on the wall on the Mexican border had “evolved.”

Trump rebuked Kelly the next day on Twitter without mentioning him by name.

People close to the White House were divided on how much Kelly’s standing was damaged by his dust-up with Trump.

One former Trump transition adviser described the president’s anger level as “maybe a half-Sessions,” referring to Attorney General Jeff Sessions Jefferson (Jeff) Beauregard SessionsTrump's policies on refugees are as simple as ABCs Ocasio-Cortez, Velázquez call for convention to decide Puerto Rico status White House officials voted by show of hands on 2018 family separations: report MORE, who has been stuck in Trump’s doghouse since recusing himself from the Justice Department's investigation into Russian election meddling.

Trump was “annoyed and angry” and “felt it was an unforced error but also felt it wasn’t going to jeopardize their relationship,” the former adviser said.

Multiple White House officials also knocked down a Vanity Fair report that said Trump is actively discussing replacements for Kelly, with the help of his elder daughter and senior adviser, Ivanka Trump Ivana (Ivanka) Marie TrumpTrump, Biden vie for Minnesota Trump luxury properties have charged US government .1M since inauguration: report Ivana Trump: Ivanka could 'definitely' be first female president MORE.

White House press secretary Sarah Huckabee Sanders said she would not use the publication “for much other than a coaster,” adding that Kelly and President Trump “have a great relationship.”

Few hold the position of White House chief of staff for long, given the long hours and stress it involves. While President Obama’s last chief of staff served four years in the position, his previous four chiefs served about a year each.

A former administration official claimed the Vanity Fair report had a ring of truth, saying that Trump and others have grown frustrated with Kelly’s image as a “nanny” who is seeking too much control.

“He is not going to be gone tomorrow, or next week, or next month. It's more like a slow burn toward an eventual demise,” the former administration official said.

While Trump became frustrated with how Kelly’s remarks were portrayed in the media, Trump and Kelly spoke about the situation later and cleared up any disagreement, a source familiar with the situation said.

On Tuesday, the first day the government reopened, the president gave a vote of confidence to Kelly on Twitter.

Trump repeated his message Wednesday during an impromptu question-and-answer session with reporters in the West Wing.

“He’s doing great. He’s doing great,” Trump said of Kelly as the chief of staff stood nearby. “Fake news yesterday, or two days ago. We put out a tweet praising somebody, but only when they get a false story.”

Trump appeared to be referring to the Vanity Fair piece.

The president made his unexpected appearance during an immigration briefing with a senior administration official. Trump outlined his immigration plan , which pre-empted remarks from the official and ensured he — and not his staff — delivered his message.

While Kelly has his detractors, he has also brought stability to the White House and is widely respected, even by those frustrated that some of their access to the president is more limited.

Virtually everyone in Trump World agrees Kelly continues to garner more respect than nearly anyone on Trump’s staff.

“There’s not the same level of anxiety under Kelly than there was under [former chief of staff Reince] Priebus,” said the transition aide.

“There was a sense among the president’s supporters that Priebus was steering the ship in the wrong direction. You don’t get that same feeling with Kelly. There’s criticism he is too rigid and too strict, but it’s not chaotic and disorganized.”

And while Kelly has strong views on immigration, his defenders dispute the notion he is pulling the president to the right, saying Trump’s immigration views have been consistent since the campaign.

“The president is not as familiar with D.C. and the history of the immigration battle, and I think chief of staff Kelly helps add texture to the immigration debate,” the transition adviser said.

Kelly’s efforts to help Trump stake out a hard line on immigration is surprising to some.

Jeh Johnson, Obama's final Homeland Security secretary, had a good relationship with Kelly when the general helmed U.S. Southern Command and did not think he held the kinds of views on immigration he has shown, according to a former Obama administration official.

Kelly’s role in talks over the next month is expected to be paramount as the White House and Congress seek a new government-funding deal by a Feb. 8 deadline, and to write legislation to replace the Deferred Action for Childhood Arrivals program for young immigrants that will begin to wind down on March 5.

The top aide will forgo traveling with Trump to the World Economic Forum in Davos, Switzerland, to remain in Washington to work on an immigration “framework” the White House will release Monday.

Sen. Dick Durbin Richard (Dick) Joseph DurbinMcConnell focuses on confirming judicial nominees with COVID-19 talks stalled Senate Republicans signal openness to working with Biden Top GOP senator calls for Biden to release list of possible Supreme Court picks MORE (D-Ill.), who co-authored a bipartisan immigration bill with Graham that was shot down by the White House, said he expects Kelly to play a constructive role in the talks.

“He can be [a positive force] and I hope he will in the future,” he said this week.

Jordain Carney and Mike Lillis contributed to this story.