Calgary police say charges are pending against a man who walked into a McDonald's restaurant brandishing a paintball gun that looks like a real weapon, prompting dozens of people to flee and another man to tackle him in an effort to wrestle the weapon away.

Four officers happened to be near the McDonald's, located inside the Walmart at Marlborough Mall, just after 6 p.m. Wednesday when screaming people began fleeing from the restaurant.

The officers raced to the source of the panic and found two men wrestling over the gun.

They were able to separate the pair and take the suspect into custody.

They described the man who tried to take the gun away as a 28-year-old "Good Samaritan" who saw the suspect reach into a bag and pull out the gun, which he believed to be a genuine firearm.

"The actions of the Good Samaritan in this incident are nothing short of heroic," Acting Inspector Rod Harbridge said in a release.

"While we don't encourage people to put themselves in harm's way, there is no doubt that had this been a real firearm, he would have saved countless lives. This is yet another example of why we are proud to serve Calgarians."

Suspect faces drug and weapons charges

Police also found a small quantity of crack cocaine, methamphetamine, heroin and marijuana in the suspect's possession.

Witnesses told police more than 30 people had been in the restaurant at the time, and people were pushing and stepping on each other as they fled in panic.

Police are still investigating and say they don't yet know why the man brandished the gun in a crowded restaurant.

The 32-year-old suspect is facing several drug and weapons charges. His name has not yet been released as the charges have not yet been sworn against him.