Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

The National Security Agency may have been ordered out of the phone records business, but a secret court has said it can go ahead anyway.

In a decision published Tuesday (PDF), the Foreign Intelligence Surveillance Court, known as the FISA court, ruled Monday night that the NSA can resume bulk phone data collection for at least five more months.

"Plus ça change, plus c'est la même chose" — "the more things change, the more they stay the same" — FISA Judge Michael Mosman wrote in saying a federal appeals court ruling rejecting a libertarian activist group's motion to end the program immediately because of a separate court's ruling.

Get breaking news and insider analysis on the rapidly changing world of media and technology right to your inbox. This site is protected by recaptcha

The law allowing the NSA to hoover up millions of Americans' metadata — broad records of who called whom when and for how long — expired June 1. Congress gave the government 180 days to make the transition, during which it could continue to collect the data.

Related: Obama Signs 'USA Freedom Act' to Reform NSA Surveillance

But while that change was working its way through Congress, a federal appeals court ruled that the entire surveillance program was illegal — and it issued an injunction ordering the NSA to stop immediately.

Mosman ruled Monday that the appeals court ruling didn't apply to his court — and that the appeals court was wrong, anyway, saying its "analysis rests on mischaracterizations of how this program works."

Clash of courts? FISA Ct says 2nd Cir wrong & NSA may resume bulk phone data program. ACLU to ask 2nd Cir to halt it http://t.co/aM9X2f8fVJ — Charlie Savage (@charlie_savage) June 30, 2015

That means the NSA can resume collecting the records for the remaining five months of the transition period — unless another court steps in.

"Neither the statute nor the Constitution permits the government to subject millions of innocent people to this kind of intrusive surveillance," Jameel Jaffer, deputy legal director for the American Civil Liberties Union, said in a statement. "We intend to ask the court to prohibit the surveillance and to order the NSA to purge the records it's already collected."

And Sen. Ron Wyden, D-Oregon, a member of the Intelligence Committee, slammed the FISA court, saying in a statement: "I see no reason for the Executive Branch to restart bulk collection, even for a few months. This illegal dragnet surveillance violated Americans' rights for fourteen years without making our country any safer."