Muslim Americans say they’ve been singled out, detained and interrogated at airports – and elected officials are no exception.

Mohamed Khairullah, the longtime mayor of Prospect Park, said he was held for three hours at JFK International Airport last month, questioned about whether he knew any terrorists and forced to hand over his phone.

“It was definitely a hurtful moment where I’m thinking in my mind that this is not the America that I know,” said Khairullah, a public-school administrator. “I am very familiar with our laws and Constitution, and everything that was going on there was a violation.”

Khairullah’s story mirrors that of many travelers, who believe they are singled out because of their faith when they are pulled aside for secondary screenings and searches. Civil liberties advocates say Muslim Americans are disproportionately detained and have had their electronic devices searched or seized.

Some have apparently been stopped because their names are on a federal watchlist of “known and suspected terrorists.” Dozens of Americans sued over the watchlist, saying their names were wrongly added and that they had no meaningful way to challenge it, including a Paterson man who said he'd been barred from air travel. Last week, a federal judge in Virginia ruled that the watchlist is unconstitutional.

A U.S. Customs and Border Protection spokesperson said he could not address any individual case due to the federal Privacy Act but said the agency “treats all international travelers with integrity, respect and professionalism while keeping the highest standards of security.”

‘Did you meet with terrorists?’

Khairullah, his wife and four children, ages 1, 2, 9 and 10, visited relatives in Turkey who are Syrians displaced by war. They visited a beach, historic sites around Istanbul and a famous mosque. Khairullah also met with mayors of different towns to talk about government and business.

According to Khairullah, CBP officers who were at the gate on Aug. 2 when Khairullah exited the plane told him they were doing a random stop. During the screening, he said, they asked him what he studied in college, where he works, his mother’s name, his nicknames and where he traveled.

Khairullah said they also asked if he visited any towns with terrorist cells and whether he personally met with any terrorists.

“It’s flat-out insulting,” he said. “It’s flat-out stereotyping of Muslims and Arabs.”

At the agents’ request, he said he gave them access to his phone, which contained private emails and family photos among other information. The phone was taken to another room. Then Khairullah said he called an attorney as he grew increasingly uncomfortable and said he no longer consented to the search of his phone.

Agents told him they’d have to keep the phone, Khairullah said. They held it for 12 days until a lawyer from the New York chapter of the Council on American-Islamic Relations intervened and helped get it back.

Khairullah’s family fled persecution in Syria in 1980 and lived in Saudi Arabia before moving to the United States in 1991 when he was a teenager. Khairullah, 44, an education supervisor at Passaic County Technical Institute, also does humanitarian work, having visited refugee camps in Syria, Turkey and Bangladesh to raise money and awareness and deliver supplies.

Given his background, Khairullah said he feels a heightened sense of appreciation for freedoms in the United States, which led him want to serve his community. A former volunteer firefighter, he was elected to the Prospect Park council in 2001 and has been mayor since 2006.

Although the borough is small, the mayor is well known. In January, Gov. Phil Murphy came to Prospect Park to swear him in for another term before a packed room, praising his work and the diversity of the borough leadership.

Should travelers hand over phones?

Ahmed Mohamed, litigation director of the Council on American-Islamic Relations, New York chapter, cautioned people about unlocking and handing over their electronic devices. He said authorities may download and copy the contents and share it with other federal agencies, like the FBI. Agencies may see messages and mine information not only from the phone’s owner, but also from their friends, family and associates.

"It’s your constitutional right as an American not to have to share information private to you," he said. "If you unlock your device, you are sharing everything you have on that device — every email, text message, What'sApp message, every phone call ever made," he added.

If a traveler refuses to unlock a phone, the CBP can take the device and try to "jail break" the phone to get around the passcode.

DETAINED:14 New Jersey women alleging anti-Muslim bias at Newark Airport security

NJ EDUCATION:New Jersey first in nation to give all students access to arts education in public schools

Information from device searches has been used to recruit informants or revoke visas, Mohamed said. In one such case, authorities detained a Somali-American man with an immigrant visa for a year and a half at the Elizabeth Detention Center after officers drew mistaken conclusions from two emails sent to him.

Mohamed suggests travelers install the latest software updates and strongest security settings, which can delay authorities from unlocking electronic devices. Travelers can also call CAIR to try to negotiate a phone's return, he said.

Citizens and returning green-card holders can't be denied entry for refusing to enter their password, but may be detained or have their device seized.

CAIR joined the American Civil Liberties Union and other groups in a 2017 lawsuit arguing that search and seizure of electronic devices at the border without reasonable suspicion or a warrant is unconstitutional.

“CBP believes they can do what they want at the border, but even their own policies say there needs to be reasonable suspicion to do an intrusive search of the phone,” Mohamed said, referring to a 2018 directive on border searches of electronic devices.

ACLU found that Customs and Border Protection and U.S. Immigration and Customs Enforcement allow officers to search devices for general law enforcement purposes. The policies also allow officers to retain and share information with other government entities, including state, local and foreign law enforcement agencies.

The CBP spokesperson said all international travelers arriving to the U.S. are subject to inspection and that the agency is monitoring compliance with hundreds of U.S. laws.

“For a minuscule number of travelers, 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," he said.

If there is reasonable suspicion, officers can do an advanced search using equipment to review, copy, or analyze contents of a device.

“CBP is keeping Americans safe by enforcing our nation’s laws," he said. "In an increasingly digital world, [that] depends on our ability to lawfully inspect all materials — electronic or otherwise — entering the United States."

CBP did 33,295 searches of electronic devices in fiscal year2018, up from 5,085 six years earlier, according to an April court filing. The total number of confiscations in 2018 was 172.