A National Security Agency (NSA) surveillance program has been ruled unlawful, seven years after it was exposed by whistleblower Edward Snowden.
The surveillance of millions of Americans' telephone records first came to light in 2013.
Now, the US Court of Appeals has ruled intelligence leaders who publicly defended the program lied.
And Mr Snowden has said he feels vindicated by the ruling.
He currently lives in exile in Moscow but, last year, expressed his wish to return to the US, where he faces espionage charges over his decision to go public.
“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,” Mr Snowden said.
"And yet that day has arrived," he added.
Seven years ago, as the news declared I was being charged as a criminal for speaking the truth, 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.— Edward Snowden (@Snowden) September 2, 2020
And yet that day has arrived. https://t.co/FRdG2zUA4U
Top US intelligence officials had publicly insisted the NSA had never knowingly collected data from private phone records, until Mr Snowden exposed evidence to the contrary in 2013.
Following the revelation, officials said the NSA's surveillance program had played a crucial role in fighting domestic terrorism, including the convictions of Basaaly Saeed Moalin, Ahmed Nasir Taalil Mohamud, Mohamed Mohamud, and Issa Doreh, of San Diego, for providing aid to al-Shabab militants in Somalia.
But, on Wednesday, the Court of Appeals said the claims were "inconsistent with the contents of the classified records" and the program had violated the Foreign Intelligence Surveillance Act.
The ruling will not affect the 2013 convictions.
“Today’s ruling is a victory for our privacy rights,” the American Civil Liberties Union said in a statement.
"It makes plain that the NSA’s bulk collection of Americans’ phone records violated the Constitution.”