Washington (CNN) A federal judge has ordered that the Justice Department and FBI submit James Comey's memos in full to the court under seal, in a court case brought by CNN and other media organizations for access to the documents memorializing the former FBI director's interactions with President Donald Trump.

Much from the memos has been released publicly, but some parts remain redacted. The Justice Department has said these redactions obscure information about intelligence gathering regarding foreign relations -- and some parts could reveal whether foreign surveillance was used to gather information about former national security adviser Michael Flynn.

As recently as early this month, the Justice Department argued that release of other information in the Comey memos could hurt the then-ongoing Mueller investigation.

The judge will look at these sections, according to the order from Judge James Boasberg in US District Court for the District of Columbia on Thursday.

The effort is one of the longest running in the court system pursuing documents that are likely key pieces of evidence gathered by special counsel Robert Mueller in his investigation into Russian interference in the 2016 election, Trump campaign coordination and the possible obstruction of justice by the President.

Read More