Mr. Sessions has lost no time. As the opioid crisis continues to spread, he has reversed the Obama Justice Department’s “smart on crime” initiative that encouraged prosecutors to seek lighter penalties for nonviolent drug offenders. Instead, Mr. Sessions has instructed prosecutors to seek the harshest possible sentences. He opposes criminal justice overhaul efforts championed by Jared Kushner, the Koch brothers and Republican former colleagues, including Senator Charles E. Grassley, Republican of Iowa, who has defended Mr. Sessions against Mr. Trump’s attacks. Like Mr. Trump, Mr. Sessions favors the death penalty for certain drug kingpins.

Mr. Sessions has withdrawn Obama administration guidance, known as the Cole memo, discouraging prosecutors from enforcing federal marijuana laws in states that have legalized it. That drew him into conflict with Senator Cory Gardner, Republican of Colorado, which legalized recreational marijuana in 2014. Mr. Gardner blocked confirmation votes for some 20 Justice Department appointees for months, backing down only after a phone call from Mr. Trump this month, assuring him that Colorado’s marijuana industry would not be targeted.

It was Mr. Sessions who announced Mr. Trump’s decision to end the Deferred Action for Childhood Arrivals program, an Obama executive order shielding from deportation immigrants brought to the United States illegally as children. He is suing the state of California over its sanctuary laws: “It cannot be, as it seems to be today, that someone who illegally crosses the border here on a Monday and ends up in San Francisco on Wednesday can never be deported,” Mr. Sessions said in Las Cruces. “Even if they were hauling dope to San Francisco and they got arrested, they can’t be deported. Now, how illogical and insane, really, is that?”

Unaccompanied children from Central America are flooding across the border, he warned, exploiting loopholes in the law so that they “are not able to be returned quickly,” Mr. Sessions said, citing arrests of juveniles accused of smuggling drugs. “I have ordered each United States attorney’s office along the southwest border to have a zero-tolerance policy toward illegal entry. Our goal is to prosecute every case that is brought to us. There must be consequences for illegal actions.”

Todd A. Cox, director of policy at the NAACP Legal Defense and Educational Fund Inc., said Mr. Sessions was ably carrying out Mr. Trump’s plans. “He’s put in place policies that will return us to the discredited war on drugs, which had catastrophic impacts on communities of color,” Mr. Cox said in an interview. “He is doing precisely what this administration has pledged to do.”

Some Justice employees, however, see Mr. Sessions’s stoicism as capitulation. In a survey last year of employee morale conducted by the United States Office of Personnel Management and compiled by the Partnership for Public Service, the Justice Department was ranked 11th among 18 large agencies, down from sixth in 2016. Rod J. Rosenstein, the deputy attorney general, who supervises Mr. Mueller, is also fighting for his job, pressed by Mr. Trump’s congressional allies to produce hundreds of thousands of documents related to politically delicate F.B.I. investigations.

In Las Cruces, Mr. Sessions ended his speech to the sheriffs with a favored line: “We have your back. You have our thanks.”