The Department of Homeland Security (DHS) has come under scrutiny over its policy of detaining journalists, after a Middle East correspondent for the Wall Street Journal said she was detained and asked to hand over her cellphones at Los Angeles international airport last week.

In a long Facebook post on Thursday, Maria Abi-Habib described how she was met by DHS officials while waiting in immigration after a flight that started in Beirut.

An officer, she wrote, explained it had been decided to pick her up after officers saw her name on the manifest, and realised she was a journalist who had traveled “to many dangerous places”.

The DHS enjoys broad authority at US borders and customs to search and detain incoming passengers. This power has come under new scrutiny in the digital age, as laptops and cellphones carry a great deal of personal information.

Journalists have found themselves targeted. Geoffrey King, director of the technology program at the Committee to Protect Journalists, wrote a blog about a brief detention in 2014 at Miami airport. He has also written about several other journalists who have been detained and had their electronics confiscated at US airports.

Speaking to the Guardian, King said the trend of DHS searching journalists’ electronic equipment was extremely troubling.

“We’ve been concerned about this particular issue for several years,” King said. “If you don’t have any reason to suspect somebody of something, then you shouldn’t be able to go into their devices just because they’re travelling internationally.

“In addition, and more specifically, that is particularly dangerous for journalists. It can put journalists in physical danger, it can put journalists in legal danger. It does at a more fundamental level harm the independence of journalists and their ability to report the news.”

In her Facebook post, Abi-Habib wrote that one officer escorted her to a back room, where she met another.

After questioning her, the officer asked her to hand over her cellphone, saying she wished to collect information. According to Abi-Habib: “I told her I had first amendment rights as a journalist she couldn’t violate and I was protected under. I explained I had to protect my sources of information.

“‘Did you just admit you collect information for foreign governments?’ she asked, her tone turning hostile.

“‘No, that’s exactly not what I just said,’ I replied, explaining again why I would not hand over my phones,” Abi-Habib said.

Abi-Habib told the officers her cellphones were owned by the Wall Street Journal, and they would have to contact the paper’s lawyers if they wanted to confiscate them. Thirty minutes later, after the officer had consulted with her supervisor, Abi-Habib was allowed to leave.

Abi-Habib’s Facebook post, which spread widely on social media, raised questions about DHS officials detaining journalists and searching electronic equipment without a warrant.

Abi-Habib shared a DHS document the officer gave her, which outlined the department’s right to take electronics and search them anywhere within 100 miles of a port of entry. This, Abi-Habib pointed out, would encompass all of New York City.

King said there has been some indication from the courts that electronics should not be open to warrantless search, regardless of proximity to borders. The US supreme court recognized the immense amount of private information on small electronic devices in the 2014 case Riley v California, which held that “the police generally may not, without a warrant, search digital information on a cellphone seized from an individual who has been arrested”.

This case and others could show the DHS will eventually have to follow suit. What remains unclear is why the DHS would want to confiscate a journalist’s phones.

Michael German, a fellow at the Brennan Center for Justice and former FBI special agent, said: “This is clearly a longstanding problem where journalists, particularly journalists who are writing critically of US foreign policy, seem to be targeted in this way.”

Abi-Habib had recently published a piece about dozens of state department officials calling on the government to launch targeted airstrikes against the regime in Syria.

German said her detention was clearly an exploitation of the border loophole to the fourth amendment warrant requirement. The fourth amendment requires the government to acquire a warrant before searching personal property. This is waived at borders, in order for the government to be able to find contraband.

US Customs & Border Protection spokesman Dan Hetlage said in a statement: “Due to the restrictions of the Privacy Act, CBP does not discuss individual travelers, however, all international travelers arriving to the US are subject to CBP inspection. This inspection may include electronic devices such as computers, disks, drives, tapes, mobile phones and other communication devices, cameras, music and other media players and any other electronic or digital devices. Keeping America safe and enforcing our nation’s laws in an increasingly digital world depends on our ability to lawfully examine all materials entering the US.