A Queens Village man stopped by Nassau County patrols for a traffic violation early Friday morning flashed a miniature police badge at the officer and then tried to grab the officer’s gun, police said.

Gurpreet Singh, 34, was charged with driving while intoxicated, criminal impersonation, obstructing governmental administration and several vehicle and traffic violations, Nassau police said.

advertisement | advertise on newsday

A Highway Patrol officer spotted Singh’s 2013 Infiniti veering out of its lane on Community Drive in Lake Success at 2:04 a.m., police said. The officer pulled the car over at the entrance ramp to the Long Island Expressway.

“During the investigation, Singh told the officer multiple times that he was a police officer and showed a mini badge,” police said in a news release.

After getting Singh out of the car, the suspect “attempted to grab the officer’s gun two times, at which time he was place under arrest,” the news release said.

Singh was awaiting arraignment Friday in First District Court in Hempstead.