A federal appeals court that previously ruled the National Security Agency’s bulk telephone surveillance program illegal declined to shut down the program this week, one month before the its expiration date in November.

The Second Circuit Court of Appeals declared NSA’s mass telephony metadata collection program, charged with collecting virtually all Americans’ landline telephone records, illegal as justified under Section 215 of the Patriot Act in May.

RELATED: Can the Senate Renew the Patriot Act After It Was Ruled Illegal?

Shortly after, the Senate passed the USA Freedom Act, and gave the signals intelligence agency six months to shut down the database and set up a new program with stricter requirements for storage of the data and legal, court-ordered access to it.

RELATED: Senate Passes USA Freedom Act NSA Reform Bill

The court on Thursday backed up Congress’ timeline and allowed the “215 program” to continue in its current form until the legislature’s expiration date of Nov. 29.

“Congress reacted to growing privacy concerns by passing the Freedom Act and ending the bulk telephone metadata collection program, and transitioning to a new targeted surveillance program aimed at protecting the United States from foreign terrorism,” the court wrote.

“What if any legal challenges arise from the new system have yet to be seen,” the court continued. “Congress has balanced privacy and national security by providing for a 180‐day transition period, a decision that it is uniquely suited to make. Congress’s decision to do so should be respected.”

But the Second Circuit Court of Appeals wasn’t the only courtroom mulling a preemptive shutdown of the 215 program. United States D.C. District Court Judge Richard Leon was the first federal judge to declare the program likely unconstitutional in December 2013, and issued a preliminary injunction against the collection of metadata belonging to the plaintiffs in a case brought by anti-surveillance lawyer Larry Klayman.

RELATED: Federal Judge May Lift Stay on Injunction Against NSA Phone Program

Leon stayed his motion to give the Justice Department time to appeal the case on national security grounds, but reopened the possibility in September after the D.C. Court of Appeals sent the case back down to Leon in August.

The judge again heard oral arguments from both sides earlier this month on whether to lift the stay on his preliminary injunction.

On Oct. 8 Klayman challenged the USA Freedom Act over its provision extending the program until the November deadline, while Justice Department attorney Julia A. Berman said the judge should allow the program to continue or risk suffering an “intelligence gap” in the interim between the activation of the new program.

Berman said the Freedom Act extended Patriot Act Section 215, which expired before Congress passed the reform bill, while establishing the groundwork for the new program.

Leon said Berman was “slicing the bologna too thin” with that argument, and said he still hadn’t received evidence the program prevented terrorist activity.

“I can receive classified information,” Leon told Berman. “Is it because they’re unwilling or unable?”

On Thursday the government brought the Second Circuit’s decision to Leon’s attention, which Klayman countered with a filing of his own, essentially calling Leon Americans’ last hope for shutting the program down early.

“This court is the sole protector of not just plaintiffs but of all Americans and must be commended for its intended swift action to end the government defendants’ unconstitutional lawlessness at the earliest practicable date,” Klayman wrote. “That the Second Circuit shirked its judicial responsibility for political reasons is of no import.”

Klayman said “even one day of a violation of our Constitution is one day too many,” adding Leon’s court “has correctly and courageously carried out its judicial duty,” while again asking the judge to lift his stay.

During the Oct. 8 hearing Klayman called Leon the “last hope of the American people” to shut down the program the judge described as “Orwellian” in 2013.

“In recent hearings, this court expressed and confirmed its judicial responsibility: ‘I’m prepared to lift the stay I issued … [i]t’s time to move. Let’s get going … [t]his court believes there are millions of Americans whose constitutional rights have been and are being violated,’” Klayman quoted Leon in his filing Thursday.

National Security Agency Director Mike Rogers testified before Congress last month on the transition to the new program, which he told lawmakers would be slower and less effective in preventing immediate terrorist threats.

RELATED: Rogers: New Phone Metadata Program Will Make NSA Slower, Less Effective

Rogers explained his ability to respond to urgent threats with emergency powers, which previously allowed him to access the telephony metadata database without seeking court approval first, would be gone under the new system.

In the event of a 9/11-style attack, Rogers said he doubted the agency could respond “in minutes,” as it could under the old system. The director, who also heads U.S. Cyber Command, was unequivocal in assuring lawmakers the new program would significantly reduce NSA’s operational capability.

Follow Giuseppe on Twitter