“This bill permanently stops one of the sprawling surveillance state's most intrusive overreaches and is the first step in a movement to reclaim the constitutional liberties sacrificed by the overreaching provisions of the PATRIOT Act,” Paul said in a statement.

The call-detail records program gathered metadata on domestic text messages and phone calls, which privacy activists have long said allows the government to access extremely detailed private information about U.S. citizens.

The NSA program was authorized by the 2015 USA Freedom Act, which is up for reauthorization later this year. A major congressional battle has been expected over the reauthorization of the surveillance program's legal authority, often referred to as Section 215, which is one of the USA Freedom Act's most highly contested provisions.

The USA Freedom Act, passed by Congress in 2015, authorized a pared-down version of the phone records program created by the Patriot Act after the 9/11 attacks. The 2015 law provides some safeguards against aspects of the program deemed overly invasive, but Congress renewed the government’s authority to sweep up troves of data on millions of U.S. citizens for national security purposes.

“There are more substantial reforms that Congress can make to the Patriot Act authorities expiring this year to protect Americans’ Constitutional rights,” Lofgren said in a statement. “We must also ensure that the 2015 reforms of THE USA FREEDOM Act are working as intended."

Lofgren in her statement called the bill ending the NSA call records program "uncontroversial."

Privacy groups, which have been pushing for months for Congress to take away the NSA's authority to collect phone records from U.S. citizens, hailed the legislation.

“The CDR Program was an ill-advised attempt to preserve the NSA's dubiously claimed authority to programmatically collect the records of people who have never been in contact with a person suspected of wrongdoing," Sean Vitka, policy counsel with digital rights group Demand Progress, said in a statement. "These mass surveillance programs have never stopped a single terrorist attack, but they have consistently violated both the letter and spirit of the law."