A Far Rockaway man is accused of impersonating a police officer when he tried to walk into a Woodmere synagogue on Saturday morning, police said.

Mikhail Mikhaylov, 29, is charged with second-degree criminal impersonation, Nassau County police said in a news release. He is to be arraigned Monday at First District Court in Hempstead.

advertisement | advertise on newsday

Police said Mikhaylov was wearing a blue baseball cap marked “NYPD” on the front and “police” on the side, as well as handcuffs and a pepper spray case on his belt. He tried to enter Young Israel of Woodmere on Peninsula Boulevard around 11 a.m. but was stopped by a security guard, police said. He showed the guard what appeared to be an NYPD detective shield, but when the guard asked for further police identification, Mikhaylov walked back to his car and drove away.

Police arrested him Sunday afternoon in Cedarhurst, the release said.