Police said that in the two incidents, the first on April 30 and the second this past Monday, a man driving a car pulled behind another driver in New Brunswick and flashed his lights and honked his horn to stop the other motorist.

Then the man approached the driver, pulled out a badge, claimed he was an undercover police officer, searched the driver and demanded to see identification, police said. In each case, after obtaining the driver’s wallet, the suspect said he had to go to his car to check for outstanding warrants, but instead he drove away, authorities said.

In the second incident, the thief also took a wallet from the female passenger in the victim’s car.

Miller said police recovered a badge when they arrested Hernandez. The suspect is being held in the Middlesex County jail on $40,000 bail.

Authorities are asking anyone with information about these incidents or similar incidents to call New Brunswick police Detective Joseph Nieves at (732) 745-5215.