The temporary extension of the National Security Agency's bulk phone records collection authority by the secretive court that oversees US government spying should be revoked, since a federal court ruled the program unconstitutional, according to the ACLU.

In a lawsuit filed Tuesday, the American Civil Liberties Union said the Second Circuit Court of Appeals' ruling on May 7 – which said that the NSA program that sweeps up metadata of all US phone calls is illegal – should be sufficient to shut down the program, effectively overruling the Foreign Intelligence Surveillance Court (FISC) decision that reinstated the dragnet program until late November.

The FISC renewed the bulk collection program in late June, saying the lapsed spying powers vested in the Patriot Act – which expired without renewal on June 1 – did not restrict the court from reauthorizing the program for six months before a new spying law took effect. The court is often seen as a "rubber stamp" for US government spying requests.

READ MORE: License to snoop: Court revives NSA spy program through December

In ruling the program illegal, the Second Circuit Court said that Congress never intended Section 215 of the Patriot Act to authorize the vast dragnet surveillance powers that came to be, argued the ACLU, adding that the FISC has acted improperly in allowing the bulk collection program to live on.

“The government says it will wind down this unconstitutional program eventually, but the Constitution doesn’t have a grace period,” said ACLU staff attorney Alex Abdo, who argued the case before the Second Circuit. “Bulk collection is unconstitutional and must end.”

Congress allowed the Patriot Act to expire when it approved the reform legislation known as the USA Freedom Act. President Barack Obama signed the law on June 2 to replace Patriot Act's spying provisions with those that would allow bulk phone data collection through a supposedly more restricted program that must be approved by the FISC. Specifically, private phone companies will be compelled to offer government spies the sought-after metadata, which can indicate caller location, numbers dialed, length of conversations, and other information, but not the actual conversations.

Ending bulk phone surveillance of Americans may not amount to much if Congress ignores spying on the internet: http://t.co/hq9U4oHm3q — The Intercept (@the_intercept) July 9, 2015

The Freedom Act gave the NSA six months to end the phone metadata program. Citing the law’s provision for a six-month transition period, the government quickly argued that the NSA needed to restart the bulk collection program in order to end it.

In a filing to the FISC in early June, the US Department of Justice requested permission to continue the “bulk production of call detail records” for 180 days. FISC Judge Michael Mosman obliged in the late June ruling.

“This application presents the question whether the recently-enacted USA Freedom Act ... ended the bulk collection of telephone metadata,” the judge's order said. “The short answer is yes. But in doing so, Congress deliberately carved out a 180-day period following the date of enactment in which such collection was specifically authorized. For this reason, the Court approves the application in this case.”

READ MORE: Support for US federal rulings falls by 1/3 in just 5 months

Mosman also accepted the government’s argument that the Second Circuit Court’s ruling that bulk collections were illegal did not apply to the FISC.

“Second Circuit rulings are not binding on the FISC, and this Court respectfully disagrees with that Court’s analysis, especially in view of the intervening enactment of the USA Freedom Act,” he wrote in the order. “To a considerable extent, the Second Circuit’s analysis rests on mischaracterizations of how this program works and on understandings that, if they had once been correct, have been superseded by the USA Freedom Act.”

Jameel Jaffer, the ACLU's deputy legal director, took issue with the secret court's depictions of the spying program.

“This dragnet surveillance program should never have been launched, and it should certainly be terminated now,” he said in a statement. “Not even the government contends anymore that the program has been effective, and the Second Circuit has already concluded that the program is illegal. It’s a needless and unlawful intrusion into the privacy rights of millions of innocent Americans.”

Under Judge Mosman’s order, the government will have until November 29 of this year to continue running the bulk collection program. After this date, the Freedom Act will allow the NSA to request records from phone companies based on specific search terms, after obtaining approval from the FISC.