An armed Texas man who attempted to rob a check-cashing store in Irving, Texas, was thwarted when an employee of the store triggered the alarm, allowing the robber to take a female hostage as police officers arrived and the event was caught on video.

As reported by The Dallas Morning News, the police officers aligned themselves in position, as one officer braced himself on the other side of the vehicle, to prevent the armed robber, with hostage in hand, from getting away.

The Dallas Morning News reported that police spokesman, James McLellan said that when police arrived, the gunman took a female employee hostage and came outside with her. He warned officers that he would hurt her if they approached. The gunman, who was not identified, threatened to put the woman inside a vehicle.

According to Irving police, the two officers shot the man as he moved toward the vehicle while holding a handgun to the woman. The gunman turned to his left and appeared to be moving the hostage towards the driver’s side of the vehicle. That made him a bigger target and that is when police open fired and a witness nearby captured the entire event as it went down.

Graphic Video, Viewer discretion is advised

The Irving officers shot the unidentified gunman in the head, ensuring he was not going to get away and was the only visible area for the officers to target. The hostage was shaken but unharmed.

McLellan, hailing the officers’ actions as heroic, stated after the shooting, “The two officers were here quickly and within minutes and were able to engage the suspect. They couldn’t let him leave with the hostage. … By all appearances, this was the last resort for them.”