The incident happened on the 600 block of South Grand Avenue just after 10 p.m. Saturday.
Police had been trying to detain the man on a separate robbery charge when he somehow got away.
He ran straight for the grocery store and once inside, he fired at an officer who chased after him.
The officer fired back, critically wounding the man. The suspect was hospitalized with a single gunshot wound to his upper body.
The officer was not injured and no bystanders were hurt. Neither the suspect nor the officer was immediately identified.
Glendora police say the man was wanted for his alleged involvement in an armed robbery of a Kohl's department earlier Saturday.
The Associated Press contributed to this report.