(CNN) A Muslim American mayor of a New Jersey town says border patrol agents wrongfully detained him and kept his phone when he arrived at JFK International Airport last month after returning from a vacation in Turkey.

Mohamed Khairullah, the mayor of Prospect Park, New Jersey since 2005, told CNN he was pulled aside and detained for three hours by US Customs and Border Protection agents when he and his family got off the plane.

The questioning started out innocently enough — a CBP agent asked him standard questions like about where he traveled from and who he visited. Then, according to Khairullah, the agent pivoted: "Did you meet with any terrorists?"

Mayor Khairullah said he gave a polite, "No," before asking to speak with a lawyer, believing the line of questioning was "harassment."

When he requested to end the interview, the mayor recalled the agent asked to search his phone.

Read More