It has been said millions of times after a mass shooting: The only way to stop a bad guy with a gun is a good guy with a gun.

On Thursday, The Daily Show's Jordan Klepper put the theory to the test. He trained on the basics of using a firearm and got a concealed carry permit that's valid in 30 states. Then he participated in mass shooting simulations to see how, exactly, he would hold up in such a scenario.

He failed. Miserably. In his final test, which simulated a school shooting, he shot an unarmed civilian, and he was shot multiple times by the active shooters and even law enforcement, who mistook him for the bad guy. He never took down the active shooters.

Klepper isn't the first to show just how badly the majority of people would do in mass shooting situations. Multiple simulations have demonstrated that most people, if placed in an active shooter situation while armed, will not be able to stop a shooter, and may in fact get themselves killed in the process.

As instructors told Klepper, it requires hundreds of hours of training to be able to deal with these types of situations. "There's never enough training," said Coby Briehn, a senior instructor at Advanced Law Enforcement Rapid Response Training (ALERRT), which trains law enforcement on how to deal with active shooter events. "You can never get enough."

The results explain why it's so rare for "a good guy with a gun" to stop active shooters. According to the FBI's report on active shooter events between 2000 and 2013, only about 3 percent were stopped by a civilian with a gun. Unarmed civilians actually stopped more incidents — about 13 percent. Most of the incidents — more than 56 percent — ended on the shooter's initiative, when the shooter either killed himself or herself, simply stopped shooting, or fled the scene.

More guns mean more gun deaths

The theory behind the mantra of "a good guy with a gun" is that more people should be armed, so they can be ready to defend themselves and others from an active shooter.

But the research suggests that's plainly false: When there are more guns and gun owners, there are far more gun deaths. Studies have found this to be true again and again — for homicides, suicides, domestic violence, and violence against police.

Here's one chart, from a 2007 study by Harvard School of Public Health researchers, showing the correlation between statewide firearm homicide victimization rates and household gun ownership after controlling for robbery rates:

A more recent study from 2013, led by a Boston University School of Public Health researcher, reached similar conclusions: After controlling for multiple variables, the study found that a 1 percent increase in gun ownership correlated with a roughly 0.9 percent rise in the firearm homicide rate at the state level.

This holds up around the world. As Vox's Zack Beauchamp explained, a breakthrough analysis in the 1990s by UC Berkeley's Franklin Zimring and Gordon Hawkins found that the US does not, contrary to the old conventional wisdom, have more crime in general than other Western industrial nations. Instead, the US appears to have more lethal violence — and that's driven in large part by the prevalence of guns.

"A series of specific comparisons of the death rates from property crime and assault in New York City and London show how enormous differences in death risk can be explained even while general patterns are similar," Zimring and Hawkins wrote. "A preference for crimes of personal force and the willingness and ability to use guns in robbery make similar levels of property crime 54 times as deadly in New York City as in London."

the US appears to have more lethal violence — and that's driven in large part by the prevalence of guns

This is, in many ways, intuitive: The prevalence of guns can cause petty arguments and conflicts to escalate into deadly encounters. People of every country get into arguments and fights with friends, family, and peers. But in the US, it's much more likely that someone will get angry at an argument, pull out a gun, and kill someone.

These three studies aren't the only ones to reach similar conclusions. Multiple reviews of the research, including the Harvard Injury Control Research Center's aggregation of the evidence, have consistently found a correlation between gun ownership and gun deaths after controlling for other factors.

So chances are a good guy with a gun will not stop a bad guy with a gun. In fact, trying to produce more good guys with a gun could make gun deaths far, far more frequent.

Watch: America's biggest gun problem is rarely discussed