In a 97-page ruling, a three-judge panel for the 2nd U.S. Circuit Court of Appeals held that a provision of the USA Patriot Act, known as Section 215, cannot be legitimately interpreted to allow the bulk collection of domestic calling records.

The ruling was certain to increase the tension that has been building in Congress as the provision of the act cited to justify the bulk data collection program nears a June 1 expiration.

It also comes amid a global uptick in controversy over electronic surveillance, including a push in France to increase domestic spying and a decision by Germany to reduce cooperation on surveillance with the United States.

Thursday’s ruling is the first time a higher-level court in the regular judicial system has reviewed the NSA phone records program.

It did not come with any injunction ordering the program to cease.

The House appears ready to pass a bill next week that would end the government’s bulk collection of phone records. That bill, known as the USA Freedom Act, would replace it with a new program that would preserve the NSA’s ability to analyze links between callers to hunt for terrorists but keep the bulk records in the hands of phone companies.

That proposal, however, has faced resistance from Sen. Mitch McConnell, R-Ky., the Senate majority leader. McConnell has urged a “clean extension” of Section 215 this time so the program can continue in its present form.

But the appeals court ruling called into question whether Section 215, extended or not, has ever legitimately authorized the program. The statute on its face permits only the collection of records deemed “relevant” to a national security case.