A federal judge has refused to dismiss a lawsuit challenging the government's authority to search personal electronics like cellphones at the U.S. border without warrants, saying the policies "substantially burden travelers' First Amendment rights."

The order, issued last week in U.S. District Court in Boston but not made public until Thursday, rejects the government's argument that personal electronics can be searched without warrants under the same authority that allows the Department of Homeland Security to search luggage and other physical containers.

Citing a 2014 Supreme Court ruling requiring police to get search warrants before they search criminal suspects' cellphones, Judge Denise Casper wrote in the 52-page order: "Electronic device searches are, categorically, more intrusive than searches of one's person or effects. The ability to review travelers' cellphones allows officers to view 'nearly every aspect of their lives — from the mundane to the intimate.' "

The lawsuit was brought in September on behalf of 10 U.S. citizens and a legal green-card holder by the American Civil Liberties Union and the Electronic Frontier Foundation, a nonprofit digital privacy advocacy group.

It seeks to wipe out policies that give agents of two homeland security agencies — primarily Customs and Border Protection but also Immigration and Customs Enforcement — broad discretion to search cellphones, laptop computers and other personal devices of anyone entering the country without judicial approval.

The department sought to have the suit dismissed because "the border is different," arguing that the government has "a paramount interest in protecting its territorial integrity" and that an individual's "expectation of privacy is less at the border than it is in the interior."

But Casper wrote that while the department "may be correct that the border is different, the Supreme Court and First Circuit have acknowledged that digital searches are different too since they 'implicate privacy concerns far beyond those implicated' in a typical container search."

Casper, who was appointed to the bench by President Barack Obama, wrote that electronics searches can amount to "psychological intrusion," agreeing with the plaintiffs that electronic documents are equivalent to personal papers, the privacy of which is strongly protected because "the searcher is invading not only the subject's house but his or her thoughts as well."

Government documents introduced in the case reveal that Customs and Border Protection conducted more than 30,000 device searches at the border last year, about 50 percent more than in 2016 and more than three times the number in 2015. The agency declined to comment.

Sophia Cope, a staff lawyer for the Electronic Frontier Foundation, called the ruling, which allows the suit to go forward, "a big win for the digital rights of all international travelers."

"As we've long argued, the border is not a Constitution-free zone," Cope said in a statement.

Esha Bhandari, the ACLU lawyer who argued the case, said in a statement that the plaintiffs "look forward to arguing this case on the merits and showing that these searches are unconstitutional."