A man who allegedly tried to rob people at a Mexican restaurant in Texas, USA using a fake gun got shot and killed after a customer opened fire at him.

The incident took place inside the Ranchito #4 Taqueria in southwest Houston last week on Thursday.

The surveillance footage of the incident shows the masked robber circling the tables inside the restaurant and asking customers to hand over their wallets and money to him.

Things took a U-turn for the robber when he turned around to leave. The video shows one of the customers pulling out a gun and firing at the robber from his seat.

The man shot the robber multiple times before firing at him one last time at point-blank range. The customer then collected the stolen money, gave it back to the patrons at the restaurant, and left the place before the police could arrive.

No other customer or staff member received any injuries during the confrontation. According to the Houston Police Department, the robber did not even have a real gun but had a plastic gun on him.

The 46-year-old customer, whose identity has not been revealed yet, was questioned by Houston police homicide detectives on Monday.

"After consulting with the Harris County District Attorney's Office, it was determined the shooting will be referred to a grand jury," read the statement from the Houston Police Department. Meanwhile, the robber has been identified as 30-year-old Eric Eugene Washington.

Texas laws allow people to defend themselves if they feel their lives are in danger. However, it is for the courts to decide what constitutes self-defence and what constitutes unnecessary force in this case.

According to Thomas Nixon, a former Houston police officer and now a lawyer, the man's use of force, in this case, was completely justified.

"The person he shot was in the process of committing robbery and consequently his use of force in defence of himself and innocent third parties are completely justified. He was reasonably in fear of serious bodily injury or death," Nixon told KPRC-TV.

Crime Scene
Crime scene police line | Representational Image Photo: GETTY IMAGES / SCOTT OLSON GETTY IMAGES/SCOTT OLSON