Top law enforcement leaders say they have had no bigger advocate this year than President Trump, and they are hopeful he has set the stage for fewer dangerous confrontations between officers and the public, better-equipped departments and, ultimately, reductions in crime.

Early signs are encouraging. Line-of-duty deaths, including fatal shootings of police officers, are down this year. Preliminary reports from major cities indicate that crime increases reported in the past two years are subsiding.

The Justice Department’s new focus on policing results has also toned down tensions between the federal government and local agencies. Meanwhile, racially tinged standoffs between police and the public have dissipated.

But police say they are still worried about the challenges of the opioid epidemic and wary of how they will balance the Trump administration’s focus on curbing illegal immigration without alienating immigrant communities with which they are trying to build trust.

Despite the occasional tiffs with federal law enforcement and intelligence agencies, Mr. Trump has steadfastly praised the work of local police departments, providing a much-needed boost in morale for officers across the country.

“Arguably the most significant thing a president can do is use the bully pulpit to reflect his support for law enforcement,” said National Fraternal Order of Police Executive Director Jim Pasco. “To this point in his presidency, he has certainly gone out of his way to do that. That resonates within the profession, and it’s received very favorably.”

Police said one big change is Attorney General Jeff Sessions’ curtailment of a favorite Obama-era tool: court-approved consent decrees to force reforms on local police departments. Departments that faced questions about officer misconduct or use-of-force felt they were being pushed into consent decrees that last for years at considerable cost.

Chief Tom Manger, president of the Major Cities Chiefs Association, said police forces were willing to work with the Justice Department but felt the relationship had turned one-sided.

“We were frustrated toward the end of the Obama administration with the Justice Department and some of their decisions with regard to consent decrees and how they were dealing with individual police departments they are reviewing or investigating,” said Chief Manger, who also leads the Montgomery County Police Department in Maryland.

He said there is still federal oversight, but it’s less combative.

Mr. Pasco said clashes between police and protesters at demonstrations have also slowed in recent months.

“People who otherwise might feel empowered in making these attacks see far less empathy or support from authority figures than they may have in the past,” he said.

Among the more traditional measures of public safety, the numbers are trending in the right direction.

The number of homicides reported in the 30 largest U.S. cities fell by 4.4 percent, according to a Dec. 20 Brennan Center for Justice report that appears to belie fears of a surging national crime wave.

Law enforcement officials also say they are seeing cooperation in other areas of high interest to local police.

“I sense from those in the administration that they want to be nimble enough to find what will work,” said Jonathan Thompson, head of the National Sheriff’s Association, pointing to the opioid crisis in particular.

Last week, the Justice Department announced the creation of a senior-level position tasked with overseeing efforts to combat the nationwide opioid epidemic. Mr. Sessions previously urged each federal prosecutor’s office to appoint an opioid coordinator to oversee the intake of all cases involving opioids, heroin and fentanyl.

One area of conflict, though, is immigration policy, where Mr. Trump and Mr. Sessions are pushing local departments to do more to cooperate with federal officers trying to deport illegal immigrants.

While the Obama administration was critical of “sanctuary cities” that shield illegal immigrants from exposure to deportation, the Trump administration has heightened the attacks and threatened to strip federal money from cities and counties that refuse to cooperate.

Mr. Thompson said the sheriffs association has spent the past eight months working with ICE to develop a solution to the issue. But cities including Philadelphia, Chicago and San Francisco have resisted and have even gone to court to try to head off pressure from the administration to report illegal immigrants.

As the court battles play out, jurisdictions across the U.S. are missing out on vital grant funding whether they cooperate or not.

The Justice Department has withheld $257 million in 2017 grants, concerned it won’t be able to ensure cities follow the rules if the money is distributed before the legal battles are settled.

“Holding up very important money from police officers because the federal government can’t solve immigration is just obnoxious,” said Ronal Serpas, chairman of the group Law Enforcement Leaders and a former superintendent of the New Orleans Police Department. “It’s being put on the backs of local police departments when in fact it’s a federal issue that needs to be solved.”

Complicating the problem, it’s often in poor, minority communities where a lack of trust between police and citizens lingers and can create problems in addressing crime, Mr. Serpas said.

“They have less resources, so that’s where the police end up being called to solve a problem they do not have the tools to solve,” he said.

He said officers are eager to target serious criminals but that asking them to go after lower-level offenders who would instead benefit from drug and alcohol counseling or mental health treatment sends mixed messages about the administration’s priorities.

“Let’s see some reality in solving some of the underlying issues that are creating the problems,” Mr. Serpas said. “That is where the real support will come from — when they fix those issues.”