SAN MATEO (CBS SF) — Police in San Mateo arrested a suspect on Sunday who allegedly brandished a replica firearm while impersonating an officer at two separate shopping centers, according to authorities.

The San Mateo Police Department said on Sunday afternoon shortly after 3 p.m., officers were dispatched to the Hillsdale Shopping Center after receiving multiple reports of an armed male subject with a firearm in his waistband who was behaving strangely.

Police flooded the area with officers and later learned the suspect had brandished what looked like a black handgun at several people while telling them he was an undercover police officer. Police obtained surveillance images of the suspect from Hillsdale Shopping Center security and immediately shared the images with the officers and public.

Mall surveillance photo of Allen Grabovetsky (San Mateo Police Department)

After receiving tips from the public, police learned the suspect likely left the area before officers arrived. Police continued to search the area and work with the public to identify the suspect. Investigative leads identified the suspect as 27-year-old San Mateo resident Allen Grabovetsky. Knowing he was a threat to public safety, the San Mateo Police Department continued an extensive search effort to locate Grabovetsky.

Hours later shortly before 6 p.m., the same subject was spotted exhibiting similar behavior at the nearby Laurelwood Shopping Center. He was quickly contacted and arrested.

Witnesses from Hillsdale Shopping Center and Laurelwood Shopping Center were able to confirm Grabovetsky was the same suspect from both incidents. A search of Grabovetsky’s nearby home revealed evidence that linked him with the earlier reports, including a black colored replica handgun and clothing.

Grabovetsky was transported to San Mateo County Jail and charged with impersonating a public officer and brandishing a replica firearm. Grabovetsky had previously been charged in 2010 with multiple counts of impersonating a police officer and other crimes.

Anyone with any additional information regarding the case can contact San Mateo Police Department at (650) 522-7700 for non-emergencies.