A man who threatened to shoot someone and told a witness he was a police officer was arrested Thursday morning, after the real cops arrived and called his bluff.

The San Francisco Police Department says the incident came to a head at 7 a.m. Thursday, on the 300 block of Noe Street between Market and 17th Streets in the Castro.

Police say that the suspect, a 48-year-old male, insisted that his 38-year-old male victim take him to a local hotel. When the younger man refused, police say that the suspect forced his victim east down 17th Street to Noe, where he brandished a gun and ordered the victim "to sit and tells him not to move or he will shoot him if he runs."

The gun-wielding man then demanded the victim's car keys. The victim refused to hand them over, according to the SFPD.

A passing witness who expressed concern was told to move along by the suspect, who showed "the witness a security badge and states he’s a police officer."

The witness, who clearly was not born yesterday, called 911 anyway. The real police arrived shortly thereafter and arrested the suspect, whose name has not been publicly released as of publication time.

Related: Castro Doorman Beaten In Apparent Gay Hate Crime