In a blistering opinion that highlighted a host of potential irregularities in the way the Justice Department under President Donald Trump secured an indictment against former FBI Director James Comey, a Virginia federal judge said there may be grounds to dismiss the case.

The record "points to a disturbing pattern of profound investigative missteps, missteps that led an FBIagent and a prosecutor to potentially undermine the integrity of the grand jury proceeding," wrote Magistrate Judge William Fitzpatrick Nov. 17.

Fitzpatrick was ruling on a request from Comey to see the materials from the grand jury that indicted him on Sept. 25. Although those materials are typically kept secret, even from a defendant, Fitzpatrick said the circumstances of Comey's case warranted giving him access.

The government's "actions in this case – whether purposeful, reckless, or negligent – raise genuine issues of misconduct, are inextricably linked to the government’s grand jury presentation, and deserve to be fully explored by the defense," the judge wrote.

A lawyer for Comey declined to comment. The Justice Department didn't immediately respond to a request for comment.