A Wall Street Journal reporter was detained by federal agents at the Los Angeles airport who demanded to confiscate her two cell phones -- and was surprised to find that border agents have the authority to do that.

Maria Abi-Habib, a reporter who covers the Middle East for the paper, detailed in a long Facebook post Thursday how Department of Homeland Security agents detained her in "a special section of LAX airport" to ask her questions.

Abi-Habib has both U.S. and Lebanese citizenship and was traveling on an American passport. She was flying into Los Angeles from Beirut last Thursday when she taken out of line at immigration.

"They grilled me for an hour," she wrote. "I answered jovially, because I've had enough high-level security experiences to know that being annoyed or hostile will work against you."

Abi-Habib said that the agents then asked for her cellphones in order to "collect information."

"That is where I drew the line," Abi-Habib wrote. "I told her I had First Amendment rights as a journalist she couldn't violate and I was protected under."

Related: Snowden designs a phone case that hides owner's location

According to Abi-Habib, the agent then presented a DHS document that read that the government has the right to confiscate phones within 100 miles from U.S. borders. She posted a photo of this document on the Facebook post.

"If they forgot to ask you at JFK airport for your phones, but you're having a drink in Manhattan the next day, you technically fall under this authority," she wrote. "And because they are acting under the pretense to protect the U.S. from terrorism, you have to give it up."

Abi-Habib told the agents that they would have to call the Wall Street Journal's lawyers because the phones are the property of the newspaper.

This led to the agent accusing her of "hindering the investigation." The agent left to speak with her supervisor, returning 30 minutes later to tell Abi-Habib that she was free to go.

"I have no idea why they wanted my phones," she wrote. "It could have been a way for them to download my contacts. Or maybe they expect me of terrorism or sympathizing with terrorists."

Related: KickassTorrents' huge file sharing site shut down by feds

"Why I was eventually spared, we do not know and we are writing a letter contesting DHS' treatment of me," Abi-Habib wrote. "I assume they avoided seizing my phones forcefully because they knew we would make a stink about it and have a big name behind us -- WSJ."

DHS acknowledged the incident occurred. The agency asserted it has legal authority to confiscate anyone's electronics on their way into the country.

This journalist's encounter last week highlights a little-known federal policy: Border patrol agents have sweeping powers to search a person -- even without "reasonable suspicion" of any crime.

The policy was set in 2013 when DHS reviewed its own powers and concluded that its agents were clear to search at will.

"Imposing a requirement that officers have reasonable suspicion in order to conduct a border search of an electronic device would be operationally harmful without concomitant civil rights/civil liberties benefits," it wrote.

The Wall Street Journal's editor in chief, Gerard Baker, said that the paper is "disturbed by the serious incident involving Abi-Habib."

"We have been working to learn more about these events, but the notion that Customs and Border Protection agents would stop and question one of our journalists in connection with her reporting and seek to search her cell phones is unacceptable," Baker said in a statement to CNNMoney.

Gregory T. Nojeim, a lawyer at the Center for Democracy & Technology, is concerned about these extraordinary powers.

"They should have to have reasonable suspicion when they do this," he said.