With nearly no public notice or debate, Congress on Wednesday approved legislation that critics say blesses the warrantless collection, dissemination and five-year retention of everyday Americans’ phone and Internet communications.

The controversial language was quietly incorporated into an intelligence authorization bill that passed the Senate on Tuesday and then the House on Wednesday.

The legislation, privacy advocates say, sanctions for the first time the executive branch’s warrantless collection of American communications under Executive Order 12333, issued in 1981 to authorize the interception of communications overseas.

Section 309 of the intelligence bill sets a five-year limit, with many exceptions, on the retention of U.S. persons' communications collected under that order, which was issued well before widespread use of cellphones and the Internet.

Members of Rep. Justin Amash’s staff noticed the section Wednesday morning, and the Michigan Republican rushed to the House floor, rallied opposition with a letter to colleagues and secured a roll call vote.

But opponents failed to defeat the bill, which passed 325-100 and now heads to President Barack Obama for his signature.

“This whole thing is so upsetting to me,” says John Napier Tye, a former State Department Internet policy official who went public as a whistleblower in July. Tye warns that U.S. spy agencies can evade congressional oversight and use the order to scoop up vast amounts of American communications routinely routed through foreign cables and servers.

“It is good that Congress is trying to regulate 12333 activities,” Tye says. “But the language in this bill just endorses a terrible system that allows the NSA to take virtually everything Americans do online and use it however it wants according to the rules it writes.” He says that includes sharing the intercepts with foreign governments and domestic law enforcement.

The provision says “any nonpublic telephone or electronic communication” sent by or among Americans that’s intercepted by intelligence agencies without a court order or subpoena can be stored for five years.

Intercepted communications can be stored longer if they are encrypted, include evidence of a crime or meet other exceptions.

“The NSA can take everything an American does online [and] write its own rules for how to share it with foreign governments and with the FBI, allowing a huge amount of American data to [be used to] prosecute Americans with no court oversight," Tye says.

The New York Times reported in August that the Obama administration is rewriting internal policies to allow the FBI direct access to a database of raw communications collected under the executive order.

There’s no specification in the legislation of crimes that would qualify communications for distribution to law enforcement. “The executive branch writes its own rules,” Tye says, with the FBI using parallel construction to obscure the true origin of some criminal investigations.

Amash’s chief of staff, Will Adams, says there will be congressional pushback against the expansive executive order next year.

“All of this surveillance is done without any legal process,” Adams says. He expects privacy-minded senators and House lawmakers to fight to limit use of the order alongside efforts to reform the controversial and better-known provisions of the Patriot Act and the Foreign Intelligence Surveillance Act.

The section of the bill is widely believed to have been drafted by leaders of the Senate Intelligence Committee, which on Tuesday released an executive summary of a still-classified report on the CIA’s use of brutal interrogation tactics.

Editorial Cartoons on the NSA View All 107 Images

“It’s interesting that this provision gets rushed through the same week the same committee puts out its torture report that documents unsupervised and very troubling actions by our intelligence community,” Adams says. “It’s an inopportune time to give the intelligence community even more surveillance power without court supervision and without congressional oversight.”

Neema Singh Guliani, a legislative counsel at the American Civil Liberties Union's Washington Legislative Office, says that although the provision “appears to be an attempt by Congress to place statutory restrictions on the retention of information collected under EO 12333,” its wording is inadequate and contains “significant loopholes.”

“Given the lack of information on how information collected under EO 12333 is currently being treated and the weakness of the provision, it is difficult to determine whether the restrictions in Section 309 would be an improvement over current practice,” Guliani says.