SALISBURY, N.C. — An armed robbery suspect was shot by a Salisbury Police officer after taking five people hostage inside a Harris Teeter store overnight, police said.

Salisbury Police responded to the Harris Teeter on Jake Alexander Boulevard around 11:30 Thursday night for a reported robbery. When police arrived, they learned the suspect, 30-year-old Cody Maxwell Schimmels had taken hostages, four employees and one employee's spouse, while trying to get into the store's safe.

Cody Maxwell Schimmels mugshot
Cody Maxwell Schimmels
Salisbury Police

When officers tried to negotiate the armed suspect's surrender, he allegedly threatened to hurt one of the hostages. That's when an officer shot the suspect with his rifle. The suspect was immediately taken into custody and all of the hostages were released from the store. Salisbury Police said the standoff lasted nearly 40 minutes before Schimmels was shot.

“Upon arrival, it was determined that there had been a robbery and that the suspect had hostages in the building,” said a Salisbury Police spokesperson. “That’s when an officer fired his weapon striking the suspect.”

Schimmels was rushed to a Salisbury hospital before being taken to a Winston-Salem hospital by helicopter. He is currently listed in critical condition.

Police have not identified the officer involved in the shooting. Salisbury Police said the SBI is leading the investigation of the shooting.

“At this point, the SBI is being called in to investigating the officer-involved shooting,” the officer said. “They will be handling that part of the investigation, we (Salisbury Police) will be handling the robbery and kidnapping part of the investigation.”

Harris Teeter issued the following statement Friday morning:

“We are relieved and grateful that all of our valued associates and one customer involved at the Salisbury Harris Teeter are safe and unharmed. Our associates remained calm and courageous through the ordeal, aiding law enforcement’s response.

We have support teams available to everyone involved, and we will continue to assist law enforcement in their investigation. We ask for the community’s patience as we work with the proper authorities to re-open the store for business.”

NBC Charlotte's Mike Hanson contributed to this story.

For the latest updates and alerts, download the NBC Charlotte mobile app. It is available on iTunes and Google Play.

Sign up for WCNC NBC Charlotte’s 5 Things to Know newsletter and get the latest in your inbox each morning!