A US federal appeals court has ordered the dismissal of the criminal case against President Donald Trump’s former national security adviser Michael Flynn.

The US Circuit Court of Appeals for the District of Columbia said in a 2-1 ruling that the Justice Department’s decision to abandon the case against Mr Flynn settles the matter, even though he pleaded guilty as part of special counsel Robert Mueller’s Russia investigation to lying to the FBI.

The ruling is a significant win for both Mr Flynn and the US Justice Department and cuts short what could have been a protracted legal fight to dissect the basis for the government’s dismissal of the case.

READ MORE: Nicola Sturgeon: Beer gardens in Scotland set to reopen on July 6

It came as Democrats question whether the Justice Department has become too politicised and attorney General William Barr too quick to side with the president, particularly as he moves to scrutinise – and even undo – some of the results of the Russia probe.

The House Judiciary Committee is holding a hearing centred on another unusual move by Mr Barr to overrule his own prosecutors and ask for less prison time for another associate of Mr Trump’s, Roger Stone.

Mr Barr has agreed to give evidence before the panel on July 28, a spokeswoman said, and he will almost certainly be pressed about Mr Flynn’s case then.

Mr Trump tweeted just moments after the ruling became public: “Great! Appeals Court Upholds Justice Departments Request to Drop Criminal Case Against General Michael Flynn.”

US District Judge Emmet Sullivan had declined to immediately dismiss the case, seeking instead to evaluate on his own the department’s request. He appointed a retired federal judge to argue against the Justice Department’s position and to consider whether Mr Flynn could be held in criminal contempt for perjury. He had set a July 16 hearing to formally hear the request to dismiss the case.

Judge Neomi Rao, a Trump nominee who was joined by Judge Karen LeCraft Henderson, wrote that Mr Sullivan had overstepped his bounds by second-guessing the Justice Department’s decision. This case, she said, “is not the unusual case where a more searching inquiry is justified.”

“To begin with,” she added, “Flynn agrees with the government’s motion to dismiss, and there has been no allegation that the motion reflects prosecutorial harassment. Additionally, the government’s motion includes an extensive discussion of newly discovered evidence casting Flynn’s guilt into doubt.”

She called Mr Sullivan’s scrutiny of the government’s request an “irregular and searching” step that could force the government to justify its decision in this case and others.

“Our precedents emphatically leave prosecutorial charging decisions to the Executive Branch and hold that a court may scrutinise a motion to dismiss only on the extraordinary showing of harassment of the defendant or malfeasance such as bribery – neither of which is manifest in the record before the district court,” she wrote.

Some critics of the Justice Department’s move urged the full appeals court to take up the case and reverse the decision of the three-judge panel, as it is empowered to do.

In a dissent, Judge Robert Wilkins said it was the first time the court had compelled a lower court judge to rule in a particular way without giving the judge a “reasonable opportunity” to reach his or her own conclusion.

“It is a great irony that, in finding the District Court to have exceeded its jurisdiction, this Court so grievously oversteps its own,” wrote Mr Wilkins, an appointee of former president Barack Obama.

Mr Flynn was the only White House official charged in Mr Mueller’s investigation into ties between the Trump campaign and Russia.

He pleaded guilty to lying to the FBI days after the president’s January 2017 inauguration about conversations he had had during the presidential transition period with the Russian ambassador, in which the two men discussed sanctions that had been imposed on Russia by the Obama administration for interfering in the election.

The Justice Department moved to dismiss the case in May as part of a broader effort by Mr Barr to revisit some of the decisions reached during the Russia investigation, which he has increasingly disparaged.

READ MORE: Two Scottish towns among the most in-demand seaside locations in UK

In its motion, the department argued that Mr Flynn’s calls with the Russian ambassador were appropriate and not material to the underlying counterintelligence investigation. The department also noted that weeks before the interview, the FBI had prepared to close its investigation into Mr Flynn after not finding evidence of a crime.

But the retired judge appointed by Mr Sullivan, John Gleeson, called the Justice Department’s request a “gross abuse” of prosecutorial power and accused the government of creating a pretext to benefit an ally of the president.

Ms Henderson had asked sceptical questions of lawyers for Mr Flynn and the Justice Department during arguments earlier this month, raising the prospect she would decide in favour of leaving the case in Mr Sullivan’s hands. But she ultimately joined in the majority to have the case dismissed.