Congress this week quietly passed a bill that may give unprecedented legal authority to the government's warrantless surveillance powers, despite a last-minute effort by Rep. Justin Amash to kill the bill.

Amash staged an aggressive eleventh-hour rally Wednesday night to block passage of the Intelligence Authorization Act, which will fund intelligence agencies for the next fiscal year. The Michigan Republican sounded alarms over recently amended language in the package that he said will for the first time give congressional backing to a controversial Reagan-era decree granting broad surveillance authority to the president.

The 47-page intelligence bill was headed toward a voice vote when Amash rose to the House floor to ask for a roll call. Despite his efforts—which included a "Dear Colleague" letter sent to all members of the House urging a no vote—the bill passed 325-100, with 55 Democrats and 45 Republicans opposing.

The provision in question is "one of the most egregious sections of law I've encountered during my time as a representative," Amash wrote on his Facebook page. The tea-party libertarian, who teamed up with Rep. John Conyers in an almost-successful bid to defund the National Security Agency in the wake of the Snowden revelations, warned that the provision "grants the executive branch virtually unlimited access to the communications of every American."

The measure already passed the Senate by unanimous consent on Tuesday, and it is now on its way to the White House, where President Obama is expected to sign it.

The objections from Amash and others arose from language in the bill's Section 309, which includes a phrase to allow for "the acquisition, retention, and dissemination" of U.S. phone and Internet data. That passage will give unprecedented statutory authority to allow for the surveillance of private communications that currently exists only under a decades-old presidential decree, known as Executive Order 12333.

"If this hadn't been snuck in, I doubt it would have passed," said Rep. Zoe Lofgren, a California Democrat who voted against the bill. "A lot of members were not even aware that this new provision had been inserted last-minute. Had we been given an additional day, we may have stopped it."

Lofgren said she believed the Senate Intelligence Committee was the source of the language. The panel did not respond to requests for comment.

Lofgren also said the language was "the exact opposite of what the House passed this summer." She was referring to an amendment she championed that would have required the NSA to obtain a warrant before reading Americans' private messages that were collected through a program intended to target foreigners. "Congress is authorizing something very questionable constitutionally," Lofgren added.

A tech-industry lobbyist added: "The language is broad, and depending on how it is implemented, does little to help restore the public's lack of trust in U.S. government surveillance programs."

Backers of the section argue it would actually limit to five years the amount of time communications data could be kept at intelligence agencies, certain exceptions permitting. But it is generally acknowledged that such data is already rarely kept beyond five years, which Amash characterized as a trade-off that "provides a novel statutory basis for the executive branch's capture and use of Americans' private communications."

"The provisions in the intel authorization appear to be an attempt by Congress to place statutory restrictions on the retention of information collected under Executive Order 12333, which is not subject to court oversight, has not been authorized by Congress, and raises serious privacy concerns," said Neema Guliani, legislative counsel with the American Civil Liberties Union. "However, these restrictions are far from adequate, contain enormous loopholes, and notably completely exclude the information of non-U.S. persons."

Executive Order 12333 is not as widely known as the controversial Section 215 of the USA Patriot Act—which allows for the mass collection of domestic phone metadata. Like Section 702 of the Foreign Intelligence Surveillance Act, 12333 is intended to target foreign surveillance, although an unknown amount of U.S. data is "incidentally" tracked, particularly for citizens living overseas or those that communicate with foreigners.

But the order, which was issued by President Reagan in 1981 and twice amended by President George W. Bush, earned a burst of attention this summer when former State Department official John Napier Tye wrote extensively about it in the Washington Post.

"Executive Order 12333 contains nothing to prevent the NSA from collecting and storing all such communication—content as well as metadata— provided that such collection occurs outside the United States in the course of a lawful foreign intelligence investigation," Tye wrote. "No warrant or court approval is required, and such collection never need be reported to Congress. None of the reforms that Obama announced earlier this year will affect such collection."

In September, four House Democrats asked the Obama administration to make public "all current and future legal opinions or interpretations" concerning 12333, a request that thus far has gone unheeded. In their letter, Reps. Conyers, Lofgren, Alan Grayson, and Rush Holt join with a number of privacy groups to express concerns about the order, saying that "secret law is a threat to democracy."

Earlier this year, the Privacy and Civil Liberties Oversight Board announced it would begin a review of the legality of 12333.

President Obama in January promised to reform the NSA's mass domestic spying, but he said he would wait for Congress to enact broader reforms. A bill intended to rein in several aspects of government surveillance died in the Senate last month, falling two votes short of the 60-vote threshold needed to advance.