Current and former Justice Department officials said Tuesday they were stunned and frustrated by Attorney General William P. Barr’s move to loosen internal restrictions on how and when federal prosecutors investigate certain election-fraud cases before the results are certified — and worried that Barr was aiding President Trump’s effort to cast doubt on his defeat.

The blow to morale was felt most acutely in the Justice Department’s criminal division, which is typically a key player in prosecuting election-related offenses and setting department policy in that area, people familiar with the matter said. Like others, they spoke on the condition of anonymity to discuss internal Justice Department deliberations.

Some weeks ago, when Barr had first proposed the move, officials in the criminal division — including political leadership — had pushed back vigorously and thought they had dissuaded the attorney general from taking such a step, the people said. Then, without warning, Barr’s memo hit their email inboxes Monday night.

Within hours, the head of the department’s election-crimes branch, Richard Pilger, told colleagues he was stepping down from that job and taking a lesser position at the department, citing the new guidance, as others privately seethed.

“It’s hard to know yet whether this amounts to something worrisome or whether it’s just pleasing the boss,” said Richard L. Hasen, a law professor at the University of California at Irvine who wrote a book, “Election Meltdown,” about the growing public distrust of election results.

Hasen said that the nuts and bolts of 2020’s election went fairly well, particularly considering the extra complication of a pandemic.

“The real problems came because of the delay in counting the votes,” Hasen said, faulting Republican legislators in some states who did not support early counting, which he said created “space for all kinds of conspiracy theories,” including from the president.

Current Justice Department officials said they were puzzled by what could have motivated Barr’s move. His memo suggested prosecutors could take public steps in cases “if there are clear and apparently-credible allegations of irregularities that, if true, could potentially impact the outcome of a federal election in an individual State.”

But current and former Justice Department officials said they were unaware of any such cases amid the myriad allegations raised by the Trump campaign and the president’s supporters. Even if judges agreed with the campaign, the officials said, the challenges generally did not seem to implicate enough votes to change any results.

Current and former Justice Department officials said they now feared some of the more politically minded U.S. attorneys might be spurred by Barr’s memo to issue news releases, send letters demanding documents or take other public steps that might wrongly suggest widespread voter fraud. That, in turn, would incentivize political parties to gin up more allegations and push the department to investigate those as well.

On Tuesday, there was no immediate outward sign of such activity in various U.S. attorney’s offices. In Pennsylvania, spokespeople for three federal prosecutors’ offices all declined to comment or referred questions to Justice Department headquarters in D.C.

While Barr’s memo might placate Trump in the short term, the current and former officials said, any investigations would be unlikely to vindicate his broad claims. And in the meantime, such cases would damage public faith in the election results and eat away at the Justice Department’s credibility.

“This is a terrible idea,” said one person familiar with the debate over the directive. “You get baited into these cases all the time.”

Some current and former officials said they were concerned that Barr seemed at times to embrace theories without evidence, and they worried he might be changing department policy based on his personal suspicions about mass mail-in balloting. Before the election, Barr repeatedly attacked the practice and generally exaggerated evidence of widespread voter fraud.

“You can’t just change a policy that’s been around for 30 years based on conjecture,” the person familiar with the debate said.

A Justice Department official disputed that criticism, saying Barr and Pilger had a fundamental disagreement over the policy. Barr, this official said, believed election fraud allegations should be reviewed nimbly, on a case-by-case basis, and disliked what he saw as the automatic and irrebuttable presumption of the old policy that no overt investigative action should be taken.

This official said that the disagreement divided both career and politically appointed prosecutors and that ultimately the attorney general made the call as the head of the department.

Outside the department, Barr also drew widespread criticism.

House Judiciary Committee Chairman Jerrold Nadler (D-N.Y.), who has clashed with Barr repeatedly since his appointment in early 2019, said in a statement that the memo was “both flawed and deeply disturbing.”

“The Attorney General may think that he is merely humoring a President who will eventually concede the race and transfer power to his successor,” Nadler said. “This approach is as shortsighted as it is cynical and destructive. To be clear, Barr cannot change the outcome of the election — but in aiding President Trump in spreading lies about election officials, and in seeding doubts about the legitimacy of the election without a shred of evidence to back up their claims, Barr and the President’s other enablers threaten real harm to our country. ”

Michigan Attorney General Dana Nessel, a Democrat, blasted Barr’s move as further politicization of criminal investigations.

The memo, she said in a statement, “is transparently a favor to the President, as it lends a misplaced air of legitimacy to his baseless claims of massive widespread voter fraud in Michigan and elsewhere.”

Barr’s missive Monday night also revealed that in “specific instances,” he had already authorized prosecutors to pursue “substantial allegations of voting and vote tabulation irregularities prior to the certification of elections in your jurisdictions in certain cases.” But officials Tuesday were uncertain to which cases the attorney general was referring.

Last week, attorneys for the Trump campaign sent a letter to Barr alleging voter fraud in Nevada, where they claimed to have identified more than 3,000 people who voted improperly because there was some evidence to suggest they moved out of state. But state officials soon pushed back on that claim, saying some of those voters might have been serving in the military. A Justice Department official, speaking on the condition of anonymity, said at that time that the department was “looking into” the matter but declined to comment further.

Republican National Committee Chair Ronna McDaniel similarly last week said she had sent claims to the Justice Department about election workers in Michigan being told to backdate certain ballots, though she conceded the allegations were not fully vetted. A Justice Department official said the information McDaniel provided has been referred to the FBI, though the FBI has declined to say what — if anything — it was doing.

On Sunday, Sen. Lindsey O. Graham (R-S.C.) sent a letter to Barr and FBI Director Christopher A. Wray asking them to investigate claims made by a postal worker in Erie, Pa., that there was mishandling of mail-in ballots by postal supervisors there. A Justice Department official said officials are reviewing Graham’s letter.

Several people familiar with the investigation said Tuesday that the purported whistleblower in that case had recanted to internal U.S. Postal Service investigators.

Tom Hamburger in Detroit and Shawn Boburg in Washington contributed to this report.