The Muslim American mayor of a New Jersey town accused U.S. Customs and Border Patrol (CBP) officials at New York’s JFK airport of “flat out profiling”, wrongfully detaining him and asking him if “he knew any terrorists” at a press conference earlier this week.

Mohamed Khairullah, who has been mayor of Prospect Park, N.J., for more than a decade, said in a video posted to his Facebook page last month that CBP agents detained him and his family for almost three hours in early August after he returned home from a vacation in Turkey. The CBP also allegedly took his phone away despite his objections, Khairullah said, adding that it took him almost two weeks to get the device back.

A U.S. Customs and Border Protection spokesperson told TIME that they could not comment on the individual case because of the federal Privacy Act, but said the agency “treats all international travelers with integrity, respect and professionalism while keeping the highest standards of security.”

“All international travelers arriving to the U.S. are subject to CBP inspection,” the CBP spokesperson said. “For a miniscule number of travelers, this inspection may include electronic devices such as computers, disks, drives, tapes, mobile phones…”

Khairullah told Turkish international news channel TRT World that airport officials started questioning him about his education and occupation before probing about who he met in Turkey.

“I said I met some elected officials in Turkey because I’m really impressed by how they take care of their communities,” Khairullah said.

Then, according to Khairullah, the official asked directly whether he met any terrorists.

“That’s when I said no and that I need to be speaking to my lawyer right now and we ended the conversation there,” Khairullah said.

The Council on American-Islamic Relations gave Khairullah legal advice, he said.

“If you weren’t Muslim, if you weren’t born in Syria, why would they ask you that question?” said Ahmed Mohamed, a litigation director for the Council on American-Islamic Relations, New York, in the video that Khairullah posted last month. “It is profiling.”

Mohamed went on to describe the actions of U.S. Customs and Border Patrol as “illegal” and “unlawful.”

Write to Sanya Mansoor at sanya.mansoor@time.com.