Justice Department officials grew cautiously optimistic Thursday that the immediate crisis stemming from President Trump’s caustic public comments about politically sensitive cases had passed, though they feared the agency may remain a target until Election Day.

Hours after Trump’s longtime friend Roger Stone received his prison sentence for obstructing Congress during its investigation of Russia’s 2016 election interference, several Justice Department officials expressed relief that the sentence of three years and four months roughly corresponded to what U.S. District Judge Amy Berman Jackson called the “unprecedented” second recommendation directed by Attorney General William P. Barr.

“It was messier than we wanted, but we ended up in the same place,” said one senior official.

Another Justice Department official called Stone’s sentence a “vindication” of the attorney general’s decision last week to insert himself into the process, calling for a revised sentencing memorandum that undercut the line prosecutors’ prior recommendation of seven to nine years in prison. Four prosecutors quit the Stone case over the disagreement, and current and former Justice Department officials grew alarmed Trump was short-circuiting the law enforcement agency’s traditional independence. More than 2,600 former employees have signed onto a letter calling on Barr to resign over his handling of the matter.

After a week of nervous tension atop the agency, anxiety levels have dropped, at least for the moment, officials said, speaking on the condition of anonymity to discuss private conversations.

Senior Justice Department officials are, however, increasingly resigned to the idea that Trump is likely to continue upbraiding the department and the FBI, and that it may be a staple of his reelection campaign rhetoric — the odd spectacle of an incumbent president bashing his own Justice Department, the official said.

But this official expressed hope that the standoff between the president and his attorney general seemed to have cooled, noting that Trump was not dragging Barr directly into his public remarks about the Stone case and his related grievances.

In a public appearance in Las Vegas on Thursday, Trump suggested that Stone might win his case on appeal.

“They say he lied. But other people lied too,” Trump said, before naming former FBI officials. “You don’t know who these people are, just trust me, they all lied,” he said, to laughter from the audience.

A Justice Department spokeswoman declined to comment.

Later in the day, former FBI director James B. Comey tweeted at Trump an image of pop singer Mariah Carey singing the words, “Why are you so obsessed with me?”

The public drama surrounding the Stone case came to a head last week, when Barr said the president’s tweets were making it impossible for him to do his job. Senior advisers to Barr said he spoke out in part because he was concerned about morale inside the department.

The attorney general’s comments marked the first time a sitting member of Trump’s Cabinet publicly rebuked the president, and it was unclear whether the president would let that pass. Barr also told people close to Trump he was considering quitting if the president’s behavior continued. But Trump kept tweeting, Stone was sentenced, and Barr remained in his job.

Another Justice Department official said it did not appear Barr would quit, at least not imminently. “The Attorney General cannot control what the president does,” the official said.