A former New York City police officer was arrested Sunday and charged with spray-painting anti-Semitic messages on more than a dozen cars and several buildings in Brooklyn.

The police questioned the man, Michael Setiawan, in the 66th Precinct station house for hours about profane messages that had been scrawled in pink letters across cars and on walls in a section of Borough Park, Brooklyn, where many Orthodox Jews live.

Mr. Setiawan, 36, was charged with criminal mischief as a hate crime and aggravated harassment as a hate crime.