Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A "good Samaritan" with a gun killed an active shooter who may have been gearing up for a deadly rampage at a Texas sports bar Wednesday night, police said.

When 48-year-old James Jones walked inside the Zona Caliente Sports Bar, started yelling and then allegedly shot and killed Cesar Perez — a 37-year-old restaurant manager who'd attempted to calm him down — Arlington police said witnesses were afraid they would be next.

In addition to the gun used to kill Perez, police say Jones had another semiautomatic pistol and two knives on him. The serial number on the second gun had been scratched off, and Jones did not have a gun license, police said.

"He definitely had the capacity, if he wanted, to commit further violence and potentially kill other patrons in the business," Arlington Police Lieutenant Chris Cook told NBC News, adding that it did not appear that the shooter knew his victim.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

In this photo posted by the Arlington Police Department, police block off the parking area near Zona Caliente Sports Bar after a shooting on May 3, 2017 in Arlington, Texas. Arlington Police

An armed "good Samaritan" — as the Arlington Police labeled him — happened to be eating at the restaurant with his wife. A concealed carry permit holder, he told her to get down on the ground and then shot Jones in the back.

"I don’t think the shooter even knew where the rounds were coming from because he started shooting at the front door," Cook said, who described the scene as "chaotic."

Police reviewed video surveillance and pieced together the incident via witness interviews, but it remains unclear how many shots were fired by either individual. Police were looking into Jones’ background to see whether he suffered from any mental illnesses and were awaiting test results to find out if he was under the influence.

Related: Cop in Jordan Edwards Shooting Was Ordered to Anger Management for Past Behavior

The man who took down Jones wished to maintain his anonymity, police said, noting that he felt overwhelmed but relieved that he prevented further violence.

“We’re thankful that the good ‘Samaritan’ acted quickly and decisively to end the threat,” Cook said. “We never recommend people get involved. That’s a personal decision that a citizen has to make.”

Use of force and firearms expert Emanuel Kapelsohn told NBC News that, from his understanding, the man who took down the shooter reacted appropriately.

"I think it's to be applauded," he said. "Not everybody in the world ought to own a gun. Not everybody in the world ought to carry a gun. Not everyone in the world ought to engage an armed criminal where innocent people could be potentially injured."

"But this good Samaritan obviously had the ability to do what he did," Kapelsohn added. "Who knows how many people would be dead if he had not acted?"