A key Senate committee approved today a measure that would give congressional blessing to the NSA's bulk collection of domestic telephone metadata, and bolster the legal underpinnings of the controversial snooping program.

Sponsored by Sen. Dianne Feinstein (D-California), the head of the Senate Intelligence Committee, the proposal (.pdf) sets the stage for a major legislative battle with a competing measure unveiled Tuesday prohibiting the data collection that began in 2006 and was first disclosed by whistleblower Edward Snowden in June.

"The NSA call-records program is legal and subject to extensive congressional and judicial oversight, and I believe it contributes to our national security," Feinstein said in a statement, after the committee approved the measure in private. "But more can and should be done to increase transparency and build public support for privacy protections..."

Among other things, the package specifically adds bulk phone-metadata collection to the business records provision of the Patriot Act. In 2006, lawmakers amended the act to authorize broad, secret warrants for most any type of "tangible" records, including those held by banks, doctors and phone companies.

Rep. Jim Sensenbrenner (R-Wisconsin), the main sponsor of the Patriot Act, said both the Bush and Obama administrations wrongly interpreted the Patriot Act to allow the bulk collection of all phone call records, slamming the NSA program as an abuse of the law. Feinstein's bill certifies once and for all that the metadata program is authorized.

If it becomes law, the Feinstein bill would undermine lawsuits challenging the program under those grounds, but leave open constitutional challenges.

"This says bulk collection of American records can continue. It especially ensures and approves bulk collection despite the fact that it's under shaky legal footing," says Elizabeth Goitein, a director of Liberty and National Security Program at the Brennan Center for Justice.

Snowden provided the Guardian newspaper with a classified court opinion requiring Verizon to provide the NSA the phone numbers of both parties involved in all calls, the international mobile subscriber identity (IMSI) number for mobile callers, calling card numbers used in the call, and the time and duration of the calls. The government confirmed the authenticity of the document, and lawmakers have subsequently said other secret orders involve the nation's carriers.

Sensenbrenner and Sen. Patrick Leahy, a Democrat who heads the Judiciary Committee, unveiled legislation Tuesday that ends the collection program. No hearing date in either legislative chamber has been set to entertain that package.

Today's legislation for the first time, however, requires that when the government queries the metadata database, it must have "reasonable, articulable suspicion" of terrorism against the targeted number. The NSA has maintained that such a standard has been employed all along, but the Feinstein measure makes it law.

The bill also demands that the metadata can only be stored for up to five years, and that searches of data more than 3 years old must be approved by the attorney general. A record of searches must also be turned over to the Foreign Intelligence Surveillance Court.

The NSA is also required to publish an annual, public report of the number of database inquiries and the number of times they led to an FBI investigation.

The measure will now move to the floor of the Senate for further debate. No date has been set.