WASHINGTON — Even as President Trump has raged at Atty. Gen. Jeff Sessions, calling his actions “disgraceful” this week, Sessions arguably has done more to deliver on Trump’s hard-right agenda than any other member of the Cabinet.

From immigration enforcement to battling “sanctuary cities,” from opposing marijuana legalization to stopping what Trump labeled “carnage in America” in his inaugural speech, Sessions has proved a stalwart ally, if only because the issues were already part of his own conservative political agenda.

After months of silently enduring Trump’s taunts and tweets — mocking the attorney general as “very weak” and “beleaguered,” and all but inviting him to quit — Sessions raised eyebrows this week when he publicly pushed back for the first time.

In a Justice Department statement Wednesday, Sessions suggested the president had gone too far by questioning his decision to refer an internal dispute over a surveillance warrant to the department’s inspector general, as regulations require, rather than to its prosecutors, as Trump had demanded earlier that day on Twitter

“As long as I am the attorney general, I will continue to discharge my duties with integrity and honor, and this department will continue to do its work in a fair and impartial manner according to the law and Constitution,” he wrote.

Trump has made no secret of his anger since Sessions stepped aside last March from supervising the Russia investigation that has cast a dark cloud over the White House, a decision that Trump apparently viewed as a betrayal of Sessions’ loyalty to him.

Despite Sessions’ hard-right bona fides — he was considered one of the most conservative members of the U.S. Senate during his four terms in office — other conservatives have begun to pile on. Even his onetime Senate colleague from Alabama, fellow Republican Richard C. Shelby, hinted that it might be time for Sessions to walk.

“I wouldn’t stay at all unless the president wanted me to stay, if he appointed me,” Shelby said Thursday on Fox News. “I wouldn’t be anybody’s whipping boy.”

White House Press Secretary Sarah Huckabee Sanders offered little in the way of reassurance, saying, “The president has made his frustrations very clear.” Asked whether Trump wants Sessions to resign, she said, “Not that I know of.”

Sessions has shown no sign he’s about to give in. Friends and associates say he is willing to endure the abuse to stand up for the Justice Department and the rule of law, and continue his mission of remaking its policies to fit his deeply conservative, tough-on-crime philosophy.

“He’s decided he’s not going to be run out by the president,” said Armand DeKeyser, Sessions’ former chief of staff in the Senate. “He knows the bullets are flying all around him, and at him — most of the time at him. Nothing has been a mortal wound so far. I think he’ll keep fighting the good fight and keep doing the best he can to protect the Justice Department.”

A Justice Department spokeswoman declined to comment.

Sessions spent six years as an assistant U.S. attorney in Alabama before President Reagan nominated him in 1981 to be U.S. attorney for the Southern District of Alabama, a job he held for 12 years. Over that time, Sessions developed a strong affection for the Justice Department and its traditions, friends and associates say.

Laurie Robinson, now a law professor at George Mason University, said she grew friendly with Sessions while she worked in the Justice Department and he served on the Senate Judiciary Committee. When she was named an assistant attorney general, Sessions came to her swearing-in and, Robinson said, seemed delighted to be back in the Justice Department building.

“While there are many areas where I don’t agree with him, from a policy standpoint, he’s someone I believe is very committed to the mission of the Department of Justice,” Robinson said.

Sessions was the first U.S. senator to endorse Trump’s presidential campaign, and he did so when most of his Senate colleagues and the GOP were openly disdainful. As a key advisor, Sessions strongly supported the harsh anti-immigration message that helped propel Trump to the White House.

“Immigration is [Trump’s] thing, it’s what he sees as most important — and Sessions is one of the people who is making that happen,” said Mark Krikorian, executive director of the Center for Immigration Studies, a group that pushes for lower immigration, both legal and illegal.

As a senator, Sessions was a fierce fighter for the anti-immigration cause, playing a key role in the defeat of two major reform bills, including an ambitious effort in 2013 that had bipartisan support.

“In a sense, the president’s attacks on him are the cross he has to bear in order to bring about the changes he thinks are necessary,” said Krikorian, who grades Sessions an “A-plus” on immigration issues important to his group.

Though the Department of Homeland Security handles immigration enforcement, Sessions has utilized nearly every tool available at the Justice Department to support the widening crackdown under the Trump administration.

He has added 50 immigration judges to reduce a backlog that has clogged courts and delayed deportations. He has applied increasing pressure on sanctuary states and cities that don’t cooperate with immigration enforcement.

And he has provided Trump with the legal opinion to support the president’s decision to end the Obama-era program that deferred deportations for more than 700,000 so-called Dreamers, undocumented migrants who came to the U.S. as children. When Trump decided to rescind the program, it was Sessions who announced it.

Sessions also has moved to reverse Obama administration policies that attempted to end the use of private prisons, pressure cities to reform police practices and roll back long prison sentences.

He has moved to bring back the practice of civil forfeiture, when law enforcement seizes property used in crimes.

With an antipathy to drugs dating to his experience as a prosecutor in the 1970s, Sessions also canceled an Obama administration policy that provided harbor for states that legalized recreational marijuana.

In what could prove one of his most consequential changes, he told prosecutors to once again file the toughest charges possible against defendants in drug cases, scrapping an Obama-era policy by former Atty. Gen. Eric H. Holder Jr. that encouraged more discretion against low-level offenders.

“The U.S. attorneys pay close attention to what the attorney general says,” says Christy Lopez, a Georgetown Law School professor and former deputy chief of the Justice Department’s civil rights division.

“Eric Holder made it known that he wanted every U.S. attorney to pay attention to civil rights,” she said, “This attorney general has made it very clear that he believes marijuana possession and sales should be punished to the greatest extent of law. That’s going to be heard as well.”

joseph.tanfani@latimes.com