Washington (CNN) In recent months, as Attorney General William Barr stood on the sidelines of President Donald Trump's impeachment drama , he noted to associates how problematic the episode was for Secretary of State Mike Pompeo. As details about the President's dealing with Ukraine surfaced, Pompeo became engulfed in the drama, and Barr and associates remarked how damaging it was to Pompeo's reputation inside the State Department.

But what Barr didn't realize was that at the Justice Department, his own troubles were brewing. After a year on the job, Barr's strategy of cultivating a close relationship with Trump has worn thin among many rank and file Justice Department employees, and given rise to suspicions that the attorney general has put the President's political interests above those of the department, according to multiple DOJ officials.

Last week, that problem sprung to life in stunning fashion. Barr's decision to overrule the sentencing recommendation from four career federal prosecutors in the Roger Stone case, and their subsequent resignation from the case , led to a rare public display of internal discord from the Justice Department that dominated the news cycle for days.

It's not unusual for top Justice officials to overrule career lawyers in sentencing decisions, but the department's move to publicly disavow the prosecutors -- via an unnamed Justice official who told Fox News and other news media before the attorneys were even notified -- was a sharp rebuke that offended career employees who worry Barr is under undue political influence from the President .

The public disunity was again on display Thursday at Stone's sentencing hearing , when prosecutor John Crabb Jr., the prosecutor left to handle the case, appeared to buck his bosses and sided with his colleagues' original, stiff sentencing request.

JUST WATCHED CNN reporters describe Stone sentencing courtroom scene Replay More Videos ... MUST WATCH CNN reporters describe Stone sentencing courtroom scene 03:25

A Justice Department official said Barr felt vindicated after Stone was ordered to prison for just over three years -- in line with what the attorney general had been telling associates would be fair, and far less than what prosecutors had originally requested.

Yet the hours-long hearing on Thursday capped a two-week crisis at the Justice Department that tested the building's independence from a vindictive president, and left Barr exposed to criticism.

After publication of this story, a Justice Department official disputed that Barr made comments about Pompeo's reputation.

While Barr's issues have only recently spilled into the open, the disquiet in the ranks started much earlier, officials inside the department say. Among some of the issues: a top-down management style, with the micro-managing Barr notorious for weighing in on matters usually left for less-senior officials, and a focus that broadly appears more centered on matters in Washington -- and more specifically things the President cares about.

Current and former Justice officials describe an attorney general who doesn't readily take advice and is prone to right wing conspiracies that he reads in fringe conservative sites on the Internet.

In some ways, he's perfect for the Trump era.

"Trump wanted his Roy Cohn," a person close to Barr said, referring to the disgraced former mob lawyer who Trump still holds in high regard. "What he's gotten in Barr is someone who is extremely intelligent, not afraid to fight, or fight back and speak his mind."

In an interview, former attorney general Ed Meese said that maintaining confidence among the rank and file is paramount for a DOJ chief but doubted that Barr's standing internally was in peril.

"You may always have a few people who are hostile to leadership there," said Meese, who served under President Ronald Reagan. "I think he's doing very well and knowing Bill Barr for a long time, almost 30 years, I would say that he's got a thick enough hide that he can withstand false attacks," he said, referring to a letter signed by more than 2,600 former DOJ officials calling for Barr's resignation and other critics, including a group of federal judges whose leader voiced concern about the political implications of Barr's move.

A test for Trump-Barr relationship

JUST WATCHED AG Barr: I'm not going to be bullied by the President Replay More Videos ... MUST WATCH AG Barr: I'm not going to be bullied by the President 02:22

After taking office last February, Barr quickly became a Trump favorite. His success in steering the President through the end of the Mueller investigation-- and his public comments that minimized the findings damaging to the president -- solidified Barr's standing. The President respects and feels comfortable around Barr, current and former Justice and White House senior officials who have observed their relationship.

But the Stone case has tested that relationship. In an interview with ABC News last week , Barr for the first time publicly expressed frustration with the President, citing the reputational harm his tweeting does to the Justice Department's work. In the days following, there were even reports that Barr was contemplating resigning.

Barr's re-posturing could be aimed at quelling a quiet revolt.

Behind the scenes, there's growing concern among his supporters that Barr is at risk of losing the department. Unlike his recent predecessors, Barr has never been a prosecutor, and his Washington-centric tenure has alienated some of the 113,000 employees of the department, where the vast majority of the work is done in U.S. attorney's offices and field outposts around the country.

While his relationship with Trump appears to have settled-- a testament to the pair's strong ties -- Barr and other top Justice Department officials seem set on returning the agency to normalcy, telegraphing in internal sessions in recent days that the attorney general plans to remain in the job and working to smooth over the tension revealed in the Stone debacle.

A crisis of confidence

One day after the ABC interview, Barr gathered staff in his 5th floor suite to mark his one-year anniversary atop the Justice Department. There, he thanked them for their hard work and seemed to indicate he wasn't leaving any time soon, saying he was looking forward to the issues they'd tackle in future months, according to a person familiar with the situation.

The celebration was light, but an air of gallows humor hung above it. On Wednesday, after news broke that he was considering quitting, senior officials at Justice headquarters tried to rally employees, assuring them Barr would be staying.

Last week the crisis of confidence inside the department reached the point that some career employees drew unfavorable comparisons to past crises, such as the one following the firing of US attorneys in the George W. Bush administration, which led to the ouster of Alberto Gonzales as attorney general.

Some US attorneys around the country have sought to reassure their employees that the political drama in Washington wouldn't affect their work. Tim Shea, the interim US attorney in Washington who oversees the Stone case, held meetings late last week with each of the units in his office, following up on a promise he'd made in a staff-wide email on Wednesday to explain the circumstances around the dispute over the Stone sentencing recommendation, according to a spokeswoman for the office.

Barr has yet to send a similar email addressing the controversy to employees around the country.

The department's policy since the beginning of the Trump administration is to stick to strict sentencing guidelines, only deviating after getting permission from their bosses. But the lawyers in the Stone case ran afoul of Barr for abiding by that tough-on-crime policy.

Prosecutors and analysts have since voiced concern that the deviation could be wielded to the Justice Department's detriment by savvy defense attorneys. On Thursday, one of the first examples emerged when an attorney for a convicted mortgage fraudster won a no jail-time sentence from a judge in California after evoking the Stone case as a "watershed moment for the [sentencing] guidelines," according to the Sacramento Bee.

An adult in the administration

Attorney General William Barr speaks to reporters at the Justice Department in Washington, Monday, Jan. 13, 2020.

Barr's arrival last year was initially viewed with relief by career rank and file inside the Justice Department.

Jeff Sessions, his Senate-confirmed predecessor, was the frequent target of ridicule by the President . The brief tenure of Matt Whitaker, the acting attorney general who the President appointed to hold the job for a few weeks, was politically-tense because of the abrupt way Trump installed him.

During his first few days in office, Barr held a conference call with top prosecutors around the country and emphasized that he was there to make hard decisions, officials familiar with the call said. He encouraged lawyers to do the same.

But while attorneys general often spend their first months visiting offices around the country, Barr spent the first few months largely in Washington. He took a hands-on role in helping manage the end of the Mueller probe, and also launched a probe looking into the origins of the intelligence used to open the Russia investigation, another Trump priority.

Barr even adopted the President's phrase "no collusion" at the close of the Mueller probe, and at a Congressional hearing claimed Trump's campaign had been "spied" on, borrowing another charged Trump criticism.

Inside the Justice Department, any unease over those episodes was tempered because for the first time in three years, there was a powerful attorney general who had the President's ear.

Democrats have long accused Barr of taking instructions from Trump. But Barr's allies described a reverse dynamic— Barr was one of the adults in the administration, one of the few people who could deftly manage the mercurial president, they said.

Barr managing Trump

One such episode occurred at an Oval Office meeting in recent months. Trump along with top immigration and Justice officials had gathered to discuss whether to designate Mexican drug cartels as terrorist organizations. Barr took other officials in the meeting by surprise when he aligned himself with Trump, despite other officials warning it would create diplomatic problems with Mexico.

Even inside Justice, senior officials had told Barr such a move was not only impractical but would likely backfire on the border, according to people familiar with the discussions. One source reacted with astonishment, saying "Barr knew better," adding "I remember thinking he can't possibly agree with that" but noted he never said it publicly.

The source also thought it seemed Barr simply was placating Trump in a room where others appeared to be ganging up on the President, knowing the issue would likely die.

A DOJ official disputed that Barr agreed with Trump in an Oval Office meeting about designating the cartels as terror groups.

After flying to the Mexican capital in December to meet with top leaders there on the issue, Barr briefed Trump back in Washington. The terrorist designation didn't occur.

A Beltway AG

While Barr has cultivated a reputation for being overly focused on Washington, his absence isn't universally seen as a bad thing. One senior Justice official says that in many districts, avoiding attention from Washington is welcome. There is however one time a year every summer when top prosecutors descend on Washington for the annual US attorney conference.

William Barr plays bagpipes

It's usually a bond-building exercise, where top prosecutors get to rub elbows with their bosses. Attorneys general usually have a closed-door meeting with top prosecutors from around the country, giving them a chance to talk about issues they are facing.

But last year, they didn't get such a gathering with Barr, and several complained about the lack of attention.

Instead, the Barr gathering last June, the only event at which all the US attorneys met with him, included the media. And it became a spectacle, when Barr entered from behind a curtain playing bagpipes.

This story has been updated to include reaction from a Justice Department official.

CORRECTION: This story has been updated to more accurately describe an event Barr attended last June.