After 9/11, the Bush administration helped set up a program — called Stellarwind — allowing the National Security Agency to access and analyze the domestic calling records of Americans.
It allowed the NSA to collect records from companies like Verizon, and it used the data obtained to find hidden associates of known terror suspects. It sucked up billions of communication logs on Americans every day.
Much of its legal authority rested on executive power, and the secretive Foreign Intelligence Surveillance Court issued orders based on the Patriot Act in 2006 compelling telecoms companies to participate.
The program was among Snowden's revelations in 2013, when the Guardian published the top-secret surveillance court order compelling it to turn over customer phone records to the government.
It drew fury from civil rights advocates who said the government had gone too far, and intelligence officials couldn't point to a disrupted terror plot as a result of the program. It was significantly reformed in 2015, but it can still collect data for specific suspects.
In 2017, it targeted 40 suspects with judicial orders collected 534 million records of phone calls and text messages, the New York Times reported.
The Trump administration recently acknowledged the program had been shut down, but its asking Congress to extend the legal basis behind it.