An airport encounter last month between Prospect Park Mayor Mohamed Khairullah and federal border patrol officers is drawing scrutiny after the mayor alleged he was wrongfully detained for three hours and asked if he knew any terrorists.

Khairullah was returning with his wife and four young children from Turkey, where they had been visiting relatives displaced from Syria, when he was pulled aside by U.S. Customs and Border Protection officers at JFK International Airport in New York City.

“Just flat-out profiling, as far as I’m concerned,” Khairullah, who is Muslim, told reporters Friday afternoon at a press conference outside the municipal building.

The incident occurred Aug. 2 but was first reported Friday morning by The Record of Bergen County.

Khairullah and his family were released without any charges. He said that he still does not know what prompted the extra level of scrutiny.

“The uncertainty of why we were held is nerve-wracking,” said Khairullah, 44, who immigrated from Syria as a child but has made at least seven return trips in recent years.

A U.S. Customs and Border Protection spokesperson declined to discuss Khairullah, citing the federal Privacy Act, but said that officers treat “all international travelers with integrity, respect and professionalism while keeping the highest standards of security.”

Khairullah went into detail, though, when speaking with reporters. He said the encounter began with two officers asking everyone exiting the plane to take out their green cards and passports.

“Upon the inspection of our documents, the agent took our documents, told us that he wants to take us in to talk with us, and the other agent with him followed with him,” Khairullah said.

“During our walk to the room where I was interviewed, the agent was making light of the situation, saying, you know, this way you can get past the long lines and it’ll be a few minutes, which turned into three hours,” Khairullah said.

The agent asked him for his name, and where he works, which Khairullah said he considered “routine questions.” He is a supervisor at Passaic County Technical Institute.

Then the discussion turned probing, as the agent asked why he went to Turkey, and with whom he met.

“The line of questioning went to where he started asking me if I knew of any terrorist cells in Turkey - which I said, no,” Khairullah said.

He said his phone also was wrongfully searched.

Khairullah, on Friday, said he has not ruled out taking legal action in connection with the incident.

“As an American citizen, I didn’t feel that I needed to be asked unnecessary questions.”

While not commenting on the mayor’s claims, the Customs and Border Protection spokesperson said officers are authorized, vis laws upheld by the U.S, Supreme Court, to conduct searches.

“Our CBP officers are charged with enforcing not only immigration and customs laws, but they also enforce over 400 laws for 40 other agencies and have stopped thousands of violators of U.S. law,” the spokesperson said via email.

“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,” the spokesperson added.

“CBP is keeping Americans safe by enforcing our nation’s laws in an increasingly digital world depends on our ability to lawfully inspect all materials - electronic or otherwise - entering the United States. We are committed to preserving the rights and privacy of all people while conducting necessary and lawful actions to secure our borders,” he concluded.

Khairullah, a Democrat, was first elected in 2005.

In February 2017, one week after President Trump signed an executive order barring refugees from seven nations, including Syria, from entering the United States, Khairullah signed a local order declaring Prospect Park a sanctuary for immigrants.

He said last month’s incident will not stop him and his family from traveling abroad.

“I hope that we are not subjected to the same harassment again," the mayor said.

Rob Jennings may be reached at rjennings@njadvancemedia.com. Follow him on Twitter @RobJenningsNJ. Find NJ.com on Facebook.

Have a tip? Tell us. nj.com/tips.

Get the latest updates right in your inbox. Subscribe to NJ.com’s newsletters