WATCH: Cop walks into 7-Eleven just as armed robbery happens

WEST COVINA, Calif. (WFLA) — A California police officer was in the right place and right time when he walked right into a armed robbery in progress.

The West Covina Police Department said at bout 8:30 p.m. PDT, suspect Ramon Gonzalez, 48, of La Puente, California, walked into a 7-Eleven and asked for cigarettes.

Florida restaurant to be featured in movie starring Brad Pitt

However, while the employee began bagging the cigarettes, the suspect pulled a gun from his under his sweatshirt and demanded money from the cash register, police said.

Just as the suspect got $400 in cash in a bag, Sergeant Hernandez of the WCPD walked in by coincidence. The department said the suspect walked by the officer, but the 7-Eleven employee told the officer of the crime that just took place.

The officer then chased Gonzalez and took him into custody. The cash was promptly returned to the store, officers said.

Gonzalez was arrested on charges of robbery, felon in possession of a firearm, and carrying a concealed weapon.

For the latest news, weather, sports, and streaming video, head to WFLA.