A man was charged with impersonating a police officer in Prince William County — when he tried to pull over a man who turned out to be a real officer.

The real officer, who was off duty at the time, reported that a white Crown Victoria started following him on Benita Fitzgerald Drive shortly before 1 a.m. on Thursday morning. The Crown Victoria’s driver then turned on a spotlight attached to his car, according to a police report on the incident.

The off-duty officer pulled over, thinking the car behind him was a police car. The Crown Victoria pulled up next to the officer’s car. Then the man who had been pulled over introduced himself as a police officer, authorities said.

The driver of the Crown Victoria immediately sped away, the police report said.

The off-duty officer called the police station and reported the license plate number of the fake cop. Police followed the Crown Victoria to the intersection of Cliffview Drive and Waterway Drive in Dumfries, about three miles away, where the driver and a passenger fled on foot.

The driver, identified by police as Shawn Michael Robinson, 27, of Alexandria, turned himself in to police later on Thursday.