WASHINGTON — A federal lawsuit filed Wednesday claims the U.S. government’s growing practice of searching laptops and cellphones at the border is unconstitutional because electronic devices now carry troves of private personal and business information. The government has vociferously defended its searches as critical to protecting the homeland.

The Fourth Amendment of the Constitution prohibits unreasonable searches and seizures, and requires law enforcement to secure warrants based on probable cause. Courts, however, have made an exception for searches at U.S. ports of entry and airports. They’ve ruled the government can do warrantless border searches to enforce immigration and customs laws and protect national security.

In today’s digital world, these searches should not be conducted without a warrant, the Electronic Frontier Foundation and the American Civil Liberties Union argue.

Top officials at the Department of Homeland Security and two of its units — Customs and Border Protection and Immigration and Customs Enforcement — are named in the suit.

“People now store their whole lives, including extremely sensitive personal and business matters, on their phones, tablets and laptops, and it’s reasonable for them to carry these with them when they travel,” said foundation attorney Sophia Cope. “It’s high time that the courts require the government to stop treating the border as a place where they can end-run the Constitution.”

The foundation and ACLU filed their suit in U.S. District Court in Massachusetts on behalf of 10 American citizens and a lawful permanent resident from seven states. The plaintiffs include an artist, two journalists, a limousine driver, two students, a filmmaker, a college professor, a business owner, a computer programmer and an engineer at NASA’s Jet Propulsion Laboratory in California.

All had their electronic devices searched by border agents when they returned from trips abroad, the suit said. None had ever been accused of any wrongdoing. Border officials confiscated several plaintiffs’ devices and kept them for weeks or months. One plaintiff’s security device, confiscated in January, is still in government custody.

Matthew Wright, a 38-year-old computer programmer in Colorado, said his phone, laptop and camera were confiscated at the Denver airport on April 21, 2016, as he returned from Southeast Asia where he participated in four Frisbee tournaments. Border agents asked him to unlock his laptop.

“They said ‘If you refuse to unlock it, we’re going to confiscate it,'” he told The Associated Press in a phone interview. “I said ‘Well, I don’t want that to happen, but I’m not going to unlock it.’ And so they confiscated the laptop and then they confiscated my other electronics — my smartphone and my camera.”

When he left the airport, Wright went straight to an Apple store and spent $2,420 for a new laptop and phone, which he needed for work. Fifty-six days after being confiscated, they were mailed back to him.

DHS has not yet commented on the suit. But the government has previously emphasized that such searches are exceedingly rare. From last October to the end of March, they affected fewer than one-hundredth of 1 percent of the 189.6 million international travelers who arrived in the United States.

Searches, however, are becoming more frequent.

In the 2015 fiscal year, Customs and Border Protection searched the electronic devices of 8,503 international travelers. The number rose to 19,033 the next year. In the first half of the current fiscal year, there were 14,993 searches.

“The government cannot use the border as a dragnet to search through our private data,” ACLU attorney Esha Bhandari said.

DHS officials have asserted that U.S. citizens and everyone else are subject to examination and search by customs officials, unless exempted by diplomatic status.

The department says no court has concluded that border searches of electronic devices require a warrant. Searches, some random, have uncovered evidence of human trafficking, terrorism, child pornography, visa fraud, export controls breaches and intellectual property rights violations, according to the department.