A licensed gun owner stopped a man who was armed with an AK-47 when he robbed a Waffle House restaurant, police in Texas said.

DeSoto police say the gunman walked into the Waffle House around 2:30 a.m. Tuesday and robbed customers and the restaurant. One of the robbery victims, who was a licensed gun owner, told police that his wife was on her way to the restaurant and he feared that the man would harm her.

Officer said the man walked outside the restaurant, called out to the gunman and fired his pistol several times at the gunman. The suspect was taken to a local hospital, where he is currently on life support.

The Waffle House customer was not arrested.

Police say they are still investigating and will be referring the case to a grand jury.

Investigators are still working to identify the suspect.