A federal court has moved to dismiss charges against ex-National Security Adviser Michael Flynn, one of several Trump associates convicted of lying.
Flynn, a former three-star US general, was the highest ranking official snared by the special counsel inquiry into Russian meddling in the 2016 election.
The ruling came as a prosecutor told Congress he was pressured to go easy on long-time Trump aide Roger Stone.
Stone has been sentenced to 40 months in jail for election-related crimes.
The surprise 2-1 ruling by the US Circuit Court of Appeals for the District of Columbia came after Flynn pleaded guilty to lying to FBI investigators about his conversations with the Russian ambassador to Washington.
It follows a highly criticised request from the Department of Justice (DOJ) to drop the case and an attempt by Flynn to change his guilty plea.
The ruling orders the judge overseeing the Flynn case to immediately drop all charges and cease his scrutiny of the DOJ decision to drop the long-running prosecution. If the case is not appealed, Flynn will be legally exonerated.
President Trump cheered the "great" ruling in a tweet and called for fired FBI director James Comey to apologise to him.
The case of Flynn, who first came to many Americans' attention with his chants of "lock her up" at Trump campaign rallies in 2016, has become a political lightning rod. Mr Trump has argued that his prosecution - as well as several other of his close associates - was motivated by his political enemies in the DOJ.
He left the White House 24 days into the job after acknowledging that he had misled Vice-President Mike Pence about his conversations with the Russian ambassador.
Was there political pressure in the Roger Stone case?
Also on Thursday, Aaron Zelinsky, an assistant US attorney in Maryland who previously worked on special counsel Robert Mueller's Russia meddling inquiry, told lawmakers on the Democratic-controlled House of Representatives Judiciary Committee that he had felt "heavy pressure from the highest levels of the Department of Justice to cut Stone a break".
Mr Zelinsky testified that "political considerations" led top DOJ officials to treat Stone "differently and more leniently" because of his "relationship with the president".
Stone was found guilty in 2019 of lying to the House Intelligence Committee about his attempts to contact Wikileaks, the website that released damaging emails about Mr Trump's 2016 Democratic election rival Hillary Clinton, as well as of obstruction and witness tampering.
Prosecutors, including Mr Zelinsky, asked a judge to jail him for at least seven years, but after Mr Trump took to Twitter to call the sentencing guidelines "horrible and very unfair" and a "miscarriage of justice" Mr Barr stepped in and asked for a more lenient sentence.
All four prosecutors assigned to the Stone case - including Mr Zelinsky - quit after the lower sentence was requested.
Mr Zelinsky told lawmakers on Wednesday that he had been pressured to change a sentencing memo to the judge to ask for a lighter sentence for Stone. He said he was warned he could be fired if he did not co-operate.
"I was explicitly told that the motivation for changing the sentencing memo was political, and because the US Attorney was 'afraid of the President'."
He also said that he was directed to investigate an environmental deal made between US auto manufacturers and the state of California after Mr Trump criticised it on Twitter.
DOJ spokeswoman Kerri Kupec said: "Mr Zelinksy's allegations concerning the US Attorney's motivation are based on his own interpretation of events and hearsay (at best), not first-hand knowledge."
Why is Barr under scrutiny?
After Congressman Jerrold Nadler, who oversaw Wednesday's hearing, threatened to compel Mr Barr to testify about his "deceptions" with a subpoena, the DOJ said he would speak to the committee voluntarily on 28 July.
Mr Barr has long been criticised by Democrats for his role in several high-profile legal and political battles involving the president.
After receiving the special counsel's report on Russian meddling - and before it was made public - he delivered a summary of its findings that was called "misleading" by a federal judge and lacking "context" by Mr Mueller himself.
More recently, he distanced himself from moves to forcibly clear the park across from the White House of protesters before Mr Trump visited a nearby church for a photograph.
Over the weekend, he ordered the firing of US Attorney for the Southern District of New York Geoffrey Berman, who had in the past ordered inquiries into several Trump associates, his campaign and presidential administration.
During the hearing on Wednesday, Tennessee Democrat Steve Cohen said lawmakers "should pursue impeachment against Mr Barr because he is raining terror on the rule of law".
But Mr Barr himself has said in interviews that his department remains independent from political interference.