SAN FRANCISCO — A Bay Area federal judge shielded potential evidence in civil suits challenging the National Security Agency as the Justice Department came under fire for its representations to the Foreign Intelligence Surveillance Court.

In a four-page order issued on Friday, U.S. District Judge Jeffrey White of the Northern District of California ordered the government to protect all documents and data that are relevant to the Electronic Frontier Foundation’s challenge to the NSA’s harvesting of telephone metadata. The EFF scrambled to protect the records after the government indicated earlier this month it would begin purging records that are more than 5 years old, per the mandate of the FISC, a secretive court that oversees operations carried out under the Foreign Intelligence Surveillance Act.