Attorney General Jeff Sessions said Thursday that he plans to stay in his job despite comments from President Trump that he would not have nominated Sessions to the post had he known that he would recuse himself from the investigation of Russian meddling in the 2016 presidential campaign.

Sessions said that he had the “honor of serving as attorney general,” and that he plans “to continue to do so as long as that is appropriate.” Asked whether he could keep running the Justice Department given Trump’s comments, he responded: “I’m totally confident that we can continue to run this office in an effective way.”

But Sessions’s public expression of confidence masked deeper private tensions regarding his position in the administration and his rapport with a president who once turned to him as a confidant and policy guide.

Since his decision to recuse himself from the Russia investigation in March, Sessions has rapidly lost his standing as one of Trump’s most trusted advisers and has drifted from the president’s inner circle, according to two White House officials who spoke on the condition of anonymity to be candid.

Trump has frequently cited Sessions’s recusal to aides in private as one of the reasons he thinks his administration is under siege on Russia matters and has vented to friends that Sessions’s decision has left him vulnerable to attack, the officials said.

In recent weeks, those complaints from Trump have not abated as the White House has dealt with near daily twists regarding Russia. Trump has turned to new legal advisers on those developments rather than his longtime ally Sessions, who was the first senator to endorse Trump at a time when few in the Republican establishment supported the candidate, and has felt increasingly isolated from the White House, people close to Sessions and Trump say.

Although Sessions and his deputies are in close touch with some Trump advisers on issues of law enforcement, they are no longer driving the president’s thinking or highly influential with Trump as he navigates the controversies and plots out his agenda.

The attorney general speaks less regularly with the president, these people say, and instead has buried himself in his work at the Justice Department putting in place some of the policies Trump touted on the campaign trail, in essence remaining an ally but not a confidant.

Deputy White House press secretary Sarah Huckabee Sanders said Thursday that although the president was “disappointed” in Sessions’s decision to recuse himself, “clearly he has confidence in him or he would not be the attorney general.”

There was minimal communication between the White House and the Justice Department following Sessions’s statement Thursday that he wouldn’t resign, according to people in the administration. Justice Department officials said they were not surprised to hear the president’s criticism of Sessions, because they have been aware for months of Trump’s anger about the recusal.

Sessions, who served as a prosecutor before his career in the Senate, described the attorney general job Thursday as “something that goes beyond any thought I would have ever had for myself” and showed no sign of being ready or willing to resign from his job.

A Justice Department news conference Thursday took on a surreal quality with Sessions announcing a major case busting a shadowy online marketplace that became a hub for drug trafficking. It should have been a triumphant moment for the Justice Department in its effort to crack down on crime and narcotics, a top priority for the president. Instead, Sessions faced reporters questioning how he could continue serving as attorney general.

“We’re serving right now,” he said. “The work we’re doing today is the kind of work that we intend to continue.”

On Wednesday, the New York Times published highlights from an interview with Trump in which the president suggested that he regretted nominating Sessions.

“Sessions should have never recused himself, and if he was going to recuse himself, he should have told me before he took the job, and I would have picked somebody else,” Trump said, according to the New York Times.

Sessions’s recusal came in March after The Washington Post reported that he had met with Russia’s ambassador to the United States and had not disclosed the contacts when the matter came up at his congressional confirmation hearing. When Sessions announced the recusal, he cited his involvement with the Trump campaign.

[Sessions met with Russian envoy twice last year, encounters he later did not disclose]

Trump said Sessions’s recusal was unfair to him as president.

“How do you take a job and then recuse yourself?” he said. “If he would have recused himself before the job, I would have said, ‘Thanks, Jeff, but I’m not going to take you.’ It’s extremely unfair — and that’s a mild word — to the president.”

In the attorney general role, Sessions has proved to be one of Trump’s most loyal foot soldiers, methodically enacting policies the president supports on criminal justice.

When Sessions directed federal prosecutors nationwide in April to make immigration cases a higher priority, for example, he declared in no uncertain terms, “This is the Trump era.”

Sessions, 70, has been working long hours. He arrives at the Justice Department from his Capitol Hill home every day about 6 a.m., said several people who work with him. The back of the nameplate on his desk that he has had since he was the attorney general of Alabama says, “Be prepared,” a reference to his days as an Eagle Scout.

He has breakfast, a bowl of oatmeal heated in his microwave, in his fifth-floor office overlooking Constitution Avenue, people close to him said. Then he works out on a treadmill in a side room and showers before his meetings start at 8:20 a.m. He often doesn’t leave work until 8 p.m.

After a bruising confirmation battle, Sessions arrived at the Justice Department in February with big plans to undo many of the Obama administration’s policies on criminal justice.

[Jeff Sessions testifies: Refuses to say whether he spoke to Trump about Comey’s handling of Russia investigation]

With the Russia scandal enveloping the White House, Sessions has forged ahead with his agenda aimed at empowering law enforcement and putting more criminals behind bars.

One of Sessions’s most significant changes has been to reverse an Obama-era policy aimed at changing how prosecutors treat nonviolent drug offenders, part of an effort to end mass incarceration. Sessions, instead, has instructed lawyers to pursue “the most serious, readily provable offense,” including charges that carry mandatory minimum sentences. He also overturned the Obama administration’s decision to stop using private prisons.

This week, Sessions issued a new policy on asset forfeiture to increase seizures of cash and property by police — undoing another policy by his predecessor designed to curb abuse by law enforcement officials.

Sessions also has begun a campaign to step up the deportation of undocumented immigrants, adding 25 immigration judges to handle deportation proceedings with the promise of 125 more over the next two years. The attorney general has vowed to punish “sanctuary cities” by withholding federal funding.

Sessions is going in a different direction on voting rights issues, reversing the department’s position on a Texas voter ID law that several courts have found unconstitutional.

He has tied a recent increase in violent crime in some cities to a lack of respect for police officers and vowed that his department will be more supportive of law enforcement. Sessions has ordered Justice Department lawyers to review all reform agreements with troubled police forces nationwide to ensure that they don’t work against Trump administration goals — and he tried to delay moving forward with a police consent decree in Baltimore.

Next week, Sessions’s task force on crime reduction is set to present him with recommendations on a range of policies, including federal drug policy on marijuana. Sessions has argued for years that the Justice Department should enforce federal laws regarding marijuana, even as states have legalized the drug.

But Sessions also has faced roadblocks, including his deteriorating relationship with the president. At one point in recent months, things grew so tense between Trump and his attorney general that Sessions offered to resign.

Nearly six months into his tenure, the attorney general also has faced a personnel vacuum at the highest levels of the department and in field offices nationwide.

The nominees to head the Justice Department’s criminal, civil and national security divisions, as well as the designated solicitor general, have not had Senate confirmation hearings. And although 25 of 93 U.S. attorneys have been announced by the White House, none have been confirmed. Only two Senate-confirmed U.S. attorneys are in place across the country — and they were appointed by President Barack Obama.

[Sessions greenlights police to increase seizures of cash and property from people suspected of crimes but not charged]

Sessions’s weekends have been consumed with trying to find candidates to fill key positions to implement his law enforcement agenda. Former Justice Department officials say that acting U.S. attorneys and other high-ranking officials do not operate with the same authority as those who are nominated by the president and confirmed by the Senate.

“We’re all a little frustrated about the delay and the time that it takes to get our folks confirmed,” Deputy Attorney General Rod J. Rosenstein said. “It certainly would be easier to have everybody on board more quickly.”

Armand DeKeyser, Sessions’s former chief of staff in the Senate, visited the attorney general in his new office earlier this spring.

“There were a lot of empty offices,” said DeKeyser, executive director of the Alabama Humanities Foundation. “He said, ‘I am trying to get people up here as quick as I can.’ He kind of laughed and said, ‘I need some help up here.’ ”

Devlin Barrett contributed to this report.

Read more:

Sessions offered in recent months to resign as attorney general

Trump’s hard-line actions have an intellectual godfather: Jeff Sessions

Trump’s pick for attorney general is shadowed by race and history