Mark Wilson/Getty Images

A US court has determined that some of the FBI's surveillance activities violated Americans' constitutional rights, newly unsealed documents reveal. The Foreign Intelligence Surveillance Court ruled last year that the law enforcement agency improperly searched an NSA repository for information on Americans, according to the declassified documents.

The court found that the FBI intercepted emails without obtaining a warrant, a violation of Americans' Fourth Amendment protections against unreasonable search and seizure. The FBI appealed the decision to FISA, which affirmed the ruling and issued new querying procedures for the FBI.

Under a new requirement mandated by Congress in 2018, US agencies wishing to search the NSA repository for Americans' data must get court approval for rules covering how they intend to search the database. FBI searches of the database mustn't be overly broad. It should also have an authorized purpose and a reasonable expectation of uncovering evidence of a crime.

The FISA court, under Judge James E. Boasberg, found tens of thousands of queries executed in 2017 and 2018 were unlikely to return evidence of a crime (PDF). In one case, the court found that a contractor ran queries on himself, his relatives and other FBI employees.

As a result, the court found the FBI's querying procedures were "not consistent with the requirements of the Fourth Amendment."

The American Civil Liberties Union said the government shouldn't be able to conduct electronic surveillance of Americans' communications without a warrant.

"Any surveillance legislation considered by Congress this year must include reforms that address the disturbing abuses detailed in these opinions," ACLU Senior Legislative Counsel Neema Singh Guliani said in a statement. "Congress and the courts now have even more reason to prohibit warrantless searches of our information, and to permanently close the door on any collection of information that is not to or from a surveillance target."

The database contained electronic communications collected under Section 702 of the FISA Amendments Act, on which the NSA's warrantless surveillance program is based. A court that hears secret national security matters decides whether to let the National Security Agency collect emails, documents and other internet communications in government surveillance programs known as Prism and Upstream.

The Prism program collects communications from internet services directly. The Upstream program collects data as it travels across the internet. The programs target people outside the US but also collect the communications of Americans who communicate with the targets of spies overseas.

Under a controversial national security policy put in place by the Patriot Act after the Sept. 11, 2001, terrorist attacks, the NSA has been collecting large amounts of metadata, the digital information that accompanies electronic communications. That information included what phone numbers were on the call, when the call was placed and how long it lasted, which was then saved in a database.

Details of those programs became public in 2013 when former NSA contractor Edward Snowden revealed them to journalists, who published stories in the Guardian and The Washington Post. After those disclosures, the government declassified information about the programs and began publishing annual transparency reports about the use of the surveillance tools.

The FBI didn't immediately respond to a request for comment.