what's next

Patriot Act: The Patriot Act expires June 1 unless Congress acts.

Government agencies: U.S. Attorney General Loretta Lynch and NSA spokesman Edward Price said they are reviewing the court's decision.

Congress: Republicans and Democrats in the House have agreed on a bill to end the government's bulk collection of the records, but Senate leaders are backing a competing measure that would maintain the status quo. One sponsor, intelligence committee chairman Richard Burr, has said he is open to a compromise.

Where legislation stands: The House Judiciary Committee last month overwhelmingly passed the latest version of a bill known as the USA Freedom Act. The measure seeks to codify President Obama's proposal to end the NSA's collection and storage of the phone records. Instead, it would allow the agency to request records held by telephone companies under a court order in terrorism investigations. Under that proposal, the NSA might end up with access to even more data. As it stands, the program doesn't collect data on most mobile calls, but under a new arrangement, the NSA could request mobile records as needed from phone companies.

Associated Press