A man was clinging to life Monday night after being shot at a Walgreens store in downtown San Jose, police said.

The shooting occurred inside the store at the corner of First and Santa Clara streets about 8:30 p.m., police said. When officers arrived, they found a male suffering from a gunshot wound on the floor near the cash registers.

The man was transported to a local hospital with life threatening injuries, police said.

A preliminary investigation showed the male was trying to rob the store and was shot by a security guard, police said. The security guard is cooperating with the investigation.

Police established a crime scene on Santa Clara Street, between Market and Second streets, and were continuing the investigation late Monday night.