CNN  — 

A federal court ruled Tuesday that suspicionless searches of international travelers’ smartphones and laptops at US ports of entry are unconstitutional.

The ruling by United States District Judge Denise J. Casper reins in Department of Homeland Security policies that gave officials wide legal authority to search the belongings, including electronic devices, of travelers entering and exiting the country.

“Although governmental interests are paramount at the border … (searches) require reasonable suspicion that the devices contain contraband,” Judge Casper ruled.

The lawsuit was filed on behalf of 11 travelers: 10 US citizens and one lawful permanent resident. Their smartphones and laptops were searched without individualized suspicion, the ACLU said.

They argued the Customs and Border Protection and ICE policies that allow border searches of electronic devices without a warrant violate the Fourth Amendment, which protects against unreasonable search and seizure. It was a win in part for the travelers, as the judge limited searches at the border to those based on “reasonable suspicion,” but did not rule that officials needed to obtain a warrant.

“This is a great day for travelers who now can cross the international border without fear that the government will, in the absence of any suspicion, ransack the extraordinarily sensitive information we all carry in our electronic devices,” Sophia Cope, senior staff attorney with the Electronic Frontier Foundation (EFF) said in a statement.

CNN has reached out to US Customs and Border Protection, as well as the US Department of Homeland Security for comment.

Previously, agents were allowed to search for information that was accessible on the device itself and through the software. Officers were allowed to request passcodes and detain devices that were encrypted or inaccessible for further review.

Last year, CBP called searches at the border “essential” to enforcing the law and national security.

CNN’s Rebekah Riess and Tal Kopan contributed to this report.