A Florida man was arrested for allegedly impersonating a police officer after he tried to pull over a driver who was a real detective.

According to the Hillsborough County Sheriff's Office, Matthew Joseph Erris, 26, activated red and blue lights on the grill of his 2007 SUV on April 17 to pull over a vehicle.

Erris didn't know the driver of the car was an undercover detective with the Hillsborough County Sheriff's Office. According to the Tampa Bay Times, the detective didn't pull over, and Erris turned off the red and blue lights and passed the driver.

The detective called 911 and Erris was pulled over by a sheriff's deputy a short time later, the agency said.

After searching his vehicle, the deputy found a realistic-looking airsoft pistol in a holster and law enforcement light bar installed on his SUV, according to the sheriff's office.

The sheriff's office said it's not clear how many times Erris pulled people over. Anyone who believes they were a victim should contact authorities, the sheriff's office said.

Erris told police he installed the lights so he could get through heavy traffic, reports the Tampa Bay Times.

Follow Brett Molina on Twitter: @brettmolina23.