WASHINGTON — The U.S. attorney who had presided over an inconclusive criminal investigation into former acting FBI director Andrew McCabe was abruptly removed from the job last month in one of several recent moves by Attorney General William Barr to take control of legal matters of personal interest to President Donald Trump, according to multiple people familiar with the matter.

A person familiar with the matter confirmed to NBC News that Trump has rescinded the nomination of Jessie Liu, who had been the U.S. attorney for Washington, D.C., for a job as an undersecretary at the Treasury Department.

Liu also supervised the case against Trump associate Roger Stone. On Tuesday, all four line prosecutors withdrew from the case — and one quit the Justice Department altogether — after Barr and his top aides intervened to reverse a stiff sentencing recommendation of up to nine years in prison that the line prosecutors had filed with the court Monday. (Liu left before the sentencing recommendation was made.)

But that wasn't the first time senior political appointees had reached into a case involving a former Trump aide, officials told NBC News. Senior officials at the Justice Department also intervened last month to help change the government's sentencing recommendation for Trump's former national security adviser Michael Flynn, who pleaded guilty to lying to the FBI. While the prosecutors had once recommended up to six months in jail, their latest filing now says they believe probation would be appropriate.

The new filing came on the same day Liu was removed from her job, to be replaced the next day by a former prosecutor selected by Barr. Liu had been overseeing the criminal investigation into McCabe, who was accused by the department's inspector general of lying to investigators. McCabe has not been charged, despite calls by Trump for him to go to prison.

The resignations and the unusual moves by Barr come as Trump has sought revenge against government officials who testified after congressional Democrats subpoenaed them in their impeachment investigation. In the days since the Senate acquitted him, Trump fired his ambassador to the European Union, a political supporter whom he nominated, and had other officials moved out of the White House.

"This signals to me that there has been a political infestation," NBC News legal analyst Chuck Rosenberg, a former U.S. attorney in Virginia, said on MSNBC. "And that is the single most dangerous thing that you can do to the Department of Justice."

In the Stone case, a new filing Tuesday says the previous recommendation "does not accurately reflect the Department of Justice's position on what would be a reasonable sentence in this matter." A nine-year sentence "could be considered excessive and unwarranted under the circumstances," the filing says, declining to recommend a specific term and instead asking the judge to consider an "appropriate" sentence.

"I've never seen this happen, ever," said Gregory Brower, a former U.S. attorney for Nevada and senior FBI official. "I'd be shocked if the judge didn't order the U.S. attorney to come into court to explain it."

Earlier Wednesday morning, Trump appeared to praise Barr for intervening in the Stone case, which was an offshoot of former special counsel Robert Mueller's Russia probe. He claimed, without evidence, that the case was improper and "tainted" and that Mueller had "lied" to Congress.

"Congratulations to Attorney General Bill Barr for taking charge of a case that was totally out of control and perhaps should not have even been brought," he wrote. "Evidence now clearly shows that the Mueller Scam was improperly brought & tainted. Even Bob Mueller lied to Congress!"

Barr named Timothy Shea as interim U.S. attorney for Washington on Jan. 30. His announcement noted that it's the largest U.S. attorney's office in the country and highlighted Shea's "reputation as a fair prosecutor."

It didn't mention that Liu had been unceremoniously pushed out. Liu had been picked for a job in the Treasury Department, and normally she would have remained as U.S. attorney until the Senate voted on her nomination, current and former officials said. Trump has now rescinded her nomination to be undersecretary for terrorism and financial crimes.

The revocation of the nomination was first reported by Axios.

The change in the Flynn sentencing recommendation, coming in the midst of Trump's impeachment trial, got less attention than it might have.

On Jan. 7, after Flynn moved to withdraw his guilty plea, prosecutors in the case recommended a sentence that included possible jail time. Their original recommendation was probation, given that Flynn had cooperated in Mueller's Russia investigation.

Download the NBC News app for breaking news and politics

But, people familiar with the matter said, senior Justice Department officials pressured prosecutors to reverse course. On Jan. 29, the government filed a new document with the court saying a sentence of probation was "reasonable."

The next day, Barr announced the appointment of Shea, a former federal prosecutor.

The announcement Tuesday that the government would seek a lighter sentence for Stone came just hours after Trump called the recommendation that he serve seven to nine years "horrible and very unfair."

"Cannot allow this miscarriage of justice!" he wrote on Twitter.

Justice Department spokeswoman Kerri Kupec told NBC News that Barr had no contact with the White House and that the decision to change the sentencing recommendation was made before the Trump tweet.

That hasn't stopped critics from questioning Barr's decision to step into a case involving a longtime friend of Trump's who was convicted of lying to Congress for the express purpose, prosecutors made it clear at the trial, of protecting the president.

David Laufman, a former counterintelligence chief for the Justice Department, on Twitter called it "a shocking, cram-down political intervention in the criminal justice process. We are now truly at a break-glass-in-case-of-fire moment for the Justice Dept."

"The narrative that's been developing for a long time now is that all of these prosecutions of people connected to the president are the product of a hoax or a witch hunt," Brower said. "The president appears to be acting on that belief."