It didn’t end well for him.

A man who was pretending to be a police officer pulled over a motorist – only to discover he was an undercover cop.

According to the Hillsborough County Sheriff’s Office (HCSO), Matthew Joseph Erris, 26, turned on red and blue flashing lights in his white Chevrolet Trailblazer and tried to pull over a vehicle in Florida.

In a Facebook post, HCSO wrote: “He had no idea the other driver was a REAL undercover HCSO detective! Deputies did a REAL traffic stop on Erris. They found an airsoft pistol under his passenger seat.”

Officials said Erris is now facing a charge of impersonating a law enforcement officer.

HCSO said they were unsure how many times Erris had pulled the trick and that anyone who believes they might have been a victim should get in touch.