(CNN) A man was shot Friday after police say he opened fire at a hospital in Bakersfield, California.

Police responded to the Bakersfield Heart Hospital after they received reports of an active shooter.

Assistant Police Chief Greg Terry said the suspect first fired several shots into a glass door at the rear of the building and then entered the hospital with a handgun and an assault rifle.

The man was confronted by a security officer but no shots were fired.

Shortly after, the suspect exited the hospital and was shot by police, Terry said.

Read More