(CNN) When a South Florida undercover detective almost got pulled over earlier this week, it came as a surprise that the deputy attempting to conduct the traffic stop wasn't even a real deputy.

Despite having red and blue lights on the grill of his 2007 white Chevrolet Trailblazer, a law enforcement light bar on top of the vehicle and and a realistic-looking airsoft pistol under the front passenger seat, Matthew Joseph Erris, 26, of Dade City, was just pretending to be deputy, according to a press release from the Hillsborough County Sheriff's Office. The county encompasses the city of Tampa.

The 2007 white Chevrolet Trailblazer that attempted to pull over an undercover detective.

What Erris didn't know was that the driver of the car he tried to pull over was a real undercover detective.

The detective called 911 while keeping Erris' "patrol car" in sight, the release said.

A short time later, Erris was pulled over by a real deputy and had his vehicle searched, where the fake gun and lights were found.

Read More