A U.S. appeals court has ruled the National Security Agency's mass surveillance of Americans' phone records was illegal.
The NSA secretly collected the data without warrants. Top intelligence officials first claimed it wasn't happening, then argued the spying helped fight domestic extremism.
But the court says the program may have violated the Constitution.
It was all exposed by former NSA contractor Edward Snowden in 2013. He fled to Russia and still faces espionage charges.
Snowden said on Twitter: "I never imagined that I would live to see our courts condemn the NSA's activities as unlawful, and in the same ruling credit me for exposing them."
The American Civil Liberties Union says the ruling is a victory for Americans' privacy rights.