A federal prosecutor’s testimony Wednesday that he was pressed by supervisors to offer a more lenient sentencing recommendation for a friend of President Trump’s capped a remarkable four-month stretch in which Attorney General William P. Barr has seemed to repeatedly bend the Justice Department to Trump’s political interests — generating significant controversy but no personal consequence, legal analysts said.

Since February, Barr has intervened in two criminal cases to the benefit of those who once advised Trump; ousted a U.S. attorney who is investigating Trump’s personal lawyer; and dutifully implemented Trump’s vision for a forceful crack down on demonstrators in the District protesting police violence.

Democrats and legal observers have decried the moves — calling on Barr to resign or be investigated by his agency’s internal watchdog — and morale inside the Justice Department has plummeted, according to several Justice Department employees who spoke on the condition of anonymity to discuss the matter frankly. But lawmakers, who already held Barr in contempt last year for defying congressional subpoenas, seem to have little in the way of practical recourse.

Republicans, who control the Senate, would short-circuit any bid to impeach and remove Barr, who they have asserted is drawing ire because he is trying to ferret out the corruption of his Justice Department predecessors in a Democratic administration.

“I think Barr’s conduct has made it clear that he is not acting as the attorney general for the people of the United States, but as a private attorney to protect the interests of the president,” said former U.S. attorney Barbara McQuade. “What can be done about William Barr? I really think the only thing that can be done is impeachment. And I think that this Republican Senate has shown it doesn’t really have any appetite for that.”

The tension over allegations of Barr’s malfeasance reached new heights Wednesday as the House Judiciary Committee took testimony from two current prosecutors, including one who had worked on the team of special counsel Robert S. Mueller III.

The hearing came just as an appeals court panel dealt a blow to Barr’s critics, siding with the Justice Department and ordering a reluctant lower court judge to immediately drop the criminal case against former Trump national security adviser Michael Flynn for lying to the FBI, as Barr had sought.

Aaron Zelinsky, who formerly worked for Mueller and is now an assistant U.S. attorney in Maryland, said political leadership had pressured him and other career prosecutors to issue a lighter sentencing recommendation for Roger Stone, a longtime Trump friend convicted of lying to Congress. Zelinsky made clear that he thought the reason for the pressure was inappropriate.

“What I heard repeatedly was that this leniency was happening because of Stone’s relationship to the president, that the acting U.S. attorney for the District of Columbia was receiving heavy pressure from the highest levels of the Department of Justice and that his instructions to us were based on political considerations,” Zelinsky said.

Zelinsky’s testimony was buttressed by a different prosecutor, who works on antitrust matters and said that Barr had personally intervened to spur investigations of mergers in the marijuana industry, even when career officials thought such work was unnecessary.

The prosecutor, John Elias, said the reason seemed to be Barr’s personal distaste for the marijuana business. He also said the Justice Department’s antitrust division was made to investigate deals between the state of California and four automakers to limit emissions, a day after Trump tweeted his displeasure about the arrangement.

“Personal dislike of an industry is not a valid basis upon which to ground an antitrust investigation,” Elias said.

House Democrats said that the prosecutors’ testimony showed that Barr has politicized the Justice Department to help Trump and his friends. In a strident opening statement, Judiciary Committee Chairman Jerrold Nadler (D-N.Y.) called Barr “the president’s fixer.”

“The cancer that we must root out is his decision to place the president’s interests above the interests of the American people,” Nadler said.

Legal analysts said the hearing itself was remarkable: prosecutors such as Zelinsky are virtually never permitted or willing to speak to Congress at all, let alone to describe the deliberations surrounding a particular criminal case. They negotiated their appearances independently of the Justice Department, but their lawyers conferred with department officials about limits on their testimony.

“Mr. Zelinsky’s courageous testimony makes more painfully explicit and shocking the brazenness with which the attorney general and other Justice Department officials now readily manipulate cases to serve the president’s political ends,” said David Laufman, a former Justice Department counterintelligence official now in private practice. “And it also indicates how impervious these officials think they are to any meaningful accountability and consequences for their wrongful conduct.”

Republicans countered that Barr was appropriately focused on rooting out corruption in the FBI investigation of possible coordination between the Trump campaign and Russia that Mueller would come to take over. Their witness, former attorney general Michael Mukasey, said Barr was motivated by “the evenhanded application of law so as to achieve justice.”

“I think we’re fortunate to have a person of his temperament, talents and convictions in office during this difficult time in history,” Mukasey said.

Justice Department spokespeople had previously taken aim at both men’s testimony, noting that Zelinsky’s information was secondhand and that the department’s Office of Professional Responsibility already had looked into the antitrust division’s handling of marijuana company mergers and found no wrongdoing.

Barr previously served as attorney general in the George H.W. Bush administration, and though he was confirmed on a mostly party-line vote in February 2019, many inside the Justice Department were optimistic about his taking over. Barr was seen as unlikely — because of his age and previous accomplishments — to blindly obey Trump.

Barr’s defenders note that he has at times disappointed or questioned the president. His Justice Department declined, for example, to bring charges against former FBI director James B. Comey and former FBI deputy director Andrew McCabe, despite referrals from the Justice Department’s Office of Inspector General about possible crimes. The president has publicly suggested that both men, whom he considers political rivals, should be charged. Barr is a strong proponent of executive power, and observers say his vision often lines up neatly with Trump’s.

In Barr’s first months on the job, Mueller’s team delivered to the attorney general its final report, and Barr stepped fully into controversy. Instead of quickly releasing the report’s executive summaries, Barr condensed the findings into a four-page letter he sent to Congress. The letter declared Mueller had not found evidence to substantiate a conspiracy between the Trump campaign and Russia to influence the 2016 election, and had not reached a conclusion on whether Trump had obstructed justice. Barr said he had evaluated that question himself, and determined that Trump had not.

The bare-bones description so infuriated the special counsel team that Mueller sent a letter to Barr complaining that the attorney general “did not fully capture the context, nature, and substance” of the investigative report. Barr ultimately pushed to make public a largely unredacted copy of Mueller’s entire report, though on the day of its release, he gave a news conference characterizing it in a way that closely mirrored Trump’s talking points.

In recent months, critics have alleged that Barr has sought to undo the special counsel’s work. Zelinsky testified that career prosecutors initially won their fight over Stone’s sentencing recommendation and filed essentially the request they wanted. But early the next morning, Trump tweeted his displeasure, and Barr directed that a new memo be filed, prompting Zelinsky and three other career prosecutors to withdraw from the case.

Barr has said that he did not discuss the case with the president and that his intervention was not a result of the president’s tweet. In the episode’s aftermath, he gave a remarkable interview saying Trump’s social media missives “make it impossible for me to do my job.”

Barr asked U.S. Attorney John Durham in Connecticut to review the FBI’s Russia investigation and U.S. Attorney Jeff Jensen in St. Louis to review the Flynn case — unusual moves that critics say are meant to fuel Republican attacks on an inquiry that dogged Trump’s presidency. Last month, at Jensen’s recommendation, Barr had the Justice Department move to walk away entirely from the prosecution of Flynn, who pleaded guilty in 2017 to lying to the FBI’s about his dealings with the Russian ambassador to the United States.

Ryan Fayhee, a former Justice Department prosecutor now in private practice at Hughes Hubbard & Reed, said that Barr had “clearly participated in the systematic undoing of the Mueller investigation,” noting that — in part because of coronavirus-related releases — none of those Mueller charged are currently in prison.

“It’s thinly veiled and troubling to say the least,” Fayhee said. “Bill Barr is very bright, capable, and ran a Department of Justice that didn’t look anything like this the last time around — and didn’t act like this the last time around. The only different factor is the person in the White House.”

Critics have noted that Barr, too, has taken other steps that have fallen in line with the president’s interests. Like Trump, he has voiced skepticism about mail-in voting, telling the New York Times Magazine it could be susceptible to a foreign operation, even though current and former election officials dispute that.

At Trump’s request, he led the law enforcement response to recent protests in the District over police violence and controversially ordered the pushing back of protesters from outside of Lafayette Square near the White House on June 1. That led to police using chemical irritant and horses against largely peaceful demonstrators, just before Trump walked across the square for a photo op at St. John’s Episcopal Church. Barr has said the events were not related.

Last week, Barr moved to oust Geoffrey Berman as the U.S. attorney in Manhattan. Berman’s office has been investigating Rudolph W. Giuliani, a personal lawyer to Trump, though the Justice Department has disputed that Berman’s removal is related to any particular case.

A spokesman for Barr said Wednesday that Barr had agreed to appear before the Judiciary Committee on July 28; he has not made such an appearance since Democrats took over the House majority in 2019. Though analysts note that he is unlikely to face any legal consequences for his various recent moves, he still has to answer to his peers, the public and his own department. Thousands of Justice Department alumni have endorsed various letters calling for Barr’s ouster, and this week, a group of professors at the George Washington University Law School, from which Barr has a degree, condemned his actions.

“At some point,” said McQuade, the former U.S. attorney, “you lose the room.”