It's October 26, 1881, in Tombstone, and Arizona is not yet a state. The O.K. Corral is quiet, and it's had an unremarkable existence for the two years it's been standing—although it's about to become famous.

Marshall Virgil Earp, having deputized his brothers Wyatt and Morgan and his pal Doc Holliday, is having a gun control problem. Long-running tensions between the lawmen and a faction of cowboys – represented this morning by Billy Claiborne, the Clanton brothers, and the McLaury brothers – will come to a head over Tombstone's gun law.

The laws of Tombstone at the time required visitors, upon entering town to disarm, either at a hotel or a lawman's office. (Residents of many famed cattle towns, such as Dodge City, Abilene, and Deadwood, had similar restrictions.) But these cowboys had no intention of doing so as they strolled around town with Colt revolvers and Winchester rifles in plain sight. Earlier on this fateful day, Virgil had disarmed one cowboy forcefully, while Wyatt confronted another and county sheriff Johnny Behan failed to persuade two more to turn in their firearms.

When the Earps and Holliday met the cowboys on Fremont Street in the early afternoon, Virgil once again called on them to disarm. Nobody knows who fired first. Ike Clanton and Billy Claiborne, who were unarmed, ran at the start of the fight and survived. Billy Clanton and the McLaury brothers, who stood and fought, were killed by the lawmen, all of whom walked away.

The “Old West” conjures up all sorts of imagery, but broadly, the term is used to evoke life among the crusty prospectors, threadbare gold panners, madams of brothels, and six-shooter-packing cowboys in small frontier towns – such as Tombstone, Deadwood, Dodge City, or Abilene, to name a few. One other thing these cities had in common: strict gun control laws.

"Tombstone had much more restrictive laws on carrying guns in public in the 1880s than it has today,” says Adam Winkler, a professor and specialist in American constitutional law at UCLA School of Law. “Today, you're allowed to carry a gun without a license or permit on Tombstone streets. Back in the 1880s, you weren't.” Same goes for most of the New West, to varying degrees, in the once-rowdy frontier towns of Nevada, Kansas, Montana, and South Dakota.

Dodge City, Kansas, formed a municipal government in 1878. According to Stephen Aron, a professor of history at UCLA, the first law passed was one prohibiting the carry of guns in town, likely by civic leaders and influential merchants who wanted people to move there, invest their time and resources, and bring their families. Cultivating a reputation of peace and stability was necessary, even in boisterous towns, if it were to become anything more transient than a one-industry boom town.

Laws regulating ownership and carry of firearms, apart from the U.S. Constitution's Second Amendment, were passed at a local level rather than by Congress. “Gun control laws were adopted pretty quickly in these places,” says Winkler. “Most were adopted by municipal governments exercising self-control and self-determination.” Carrying any kind of weapon, guns or knives, was not allowed other than outside town borders and inside the home. When visitors left their weapons with a law officer upon entering town, they'd receive a token, like a coat check, which they'd exchange for their guns when leaving town.

The practice was started in Southern states, which were among the first to enact laws against concealed carry of guns and knives, in the early 1800s. While a few citizens challenged the bans in court, most lost. Winkler, in his book Gunfight: The Battle Over the Right to Bear Arms in America, points to an 1840 Alabama court that, in upholding its state ban, ruled it was a state's right to regulate where and how a citizen could carry, and that the state constitution's allowance of personal firearms “is not to bear arms upon all occasions and in all places.”

Louisiana, too, upheld an early ban on concealed carry firearms. When a Kentucky court reversed its ban, the state constitution was amended to specify the Kentucky general assembly was within its rights to, in the future, regulate or prohibit concealed carry.

Still, Winkler says, it was an affirmation that regulation was compatible with the Second Amendment. The federal government of the 1800s largely stayed out of gun-law court battles.

“People were allowed to own guns, and everyone did own guns [in the West], for the most part,” says Winkler. “Having a firearm to protect yourself in the lawless wilderness from wild animals, hostile native tribes, and outlaws was a wise idea. But when you came into town, you had to either check your guns if you were a visitor or keep your guns at home if you were a resident.”

Published in 1903, Andy Adams’s Log of a Cowboy, a “slightly fictionalized” account of the author’s life on the cattle trails of the 1880s, was a refutation against the myth-making dime store novels of the day. The book, which included stories about lawless cowboys visiting Dodge City firing into the air to shoot out lights, has been called the most realistic written account of cowboy life and is still in print today.

Adams wrote of what happened to the few who wouldn't comply with frontier gun law:

“The buffalo hunters and range men have protested against the iron rule of Dodge's peace officers, and nearly every protest has cost human life. … Most cowboys think it's an infringement on their rights to give up shooting in town, and if it is, it stands, for your six-shooters are no match for Winchesters and buckshot; and Dodge's officers are as game a set of men as ever faced danger.”

Frontier towns with and without gun legislation were violent places, more violent than family-friendly farming communities and Eastern cities of the time, but those without restrictions tended to have worse violence. “I've never seen any rhetoric from that time period saying that the only thing that's going to reduce violence is more people with guns,” says Winkler. “It seems to be much more of a 20th-century attitude than one associated with the Wild West.”

Aron agrees that these debates rarely went on, and if they did, there's scant evidence of it today.

Crime records in the Old West are sketchy, and even where they exist the modern FBI yardstick of measuring homicides rates – the number of homicides per 100,000 residents – can exaggerate statistics in Old Western towns with small populations; even one or two more murders a year would drastically swing a town's homicide rate.

Historian Robert Dykstra focused on established cattle towns, recording homicides after a full season of cattle shipments had already passed and by which time they'd have typically passed firearm law. He found a combined 45 murders from 1870-1885 in Kansas' five largest cattle towns by the 1880 census: Wichita (population: 4,911), Abilene (2,360) Caldwell (1,005), Ellsworth (929), and Dodge City (996).

Averaged out, there were 0.6 murders per town, per year. The worst years were Ellsworth, 1873, and Dodge City, 1876, with five killings each; because of their small populations, their FBI homicide rates would be high. Another historian, Rick Shenkman, found Tombstone's (1880 pop: 3,423) most violent year was 1881, in which also only five people were killed; three were the cowboys shot by Earp's men at the OK Corral.

As Dykstra wrote, frontier towns by and large prohibited the “carrying of dangerous weapons of any type, concealed or otherwise, by persons other than law enforcement officers.” Most established towns that restricted weapons had few, if any, killings in a given year.

The settlements that came closest to unchecked carry were the railroad and mining boom towns that tended to lack effective law enforcement, a functioning judicial system, and firearm law, says Aron, and it reflected in higher levels of violence. Like Bodie, California, which was well-known during the 1870s and 1880s for vigilantism and street violence.

“The smoke of battle almost never clears away completely in Bodie,” wrote a young Mark Twain on assignment for the Virginia City Territorial Enterprise. Historian Roger McGrath found that from 1877 to 1882 there were 31 homicides in Bodie which, according to the 1880 census, had only 2,712 residents. As the contemporary paper Sacramento Union called it a “shooter's town,” Bodie by 1880 had acquired a national infamy. Even as far as New York, a dangerous man was euphemistically called “a bad man from Bodie.”

The one-man law seen of TV and film Westerns is how we remember the West today. It was a time and place where rugged individualism reigned and the only law in the West that mattered was the law on your hip – a gun. Most “cowboy” films had nothing to do with driving cattle. John Wayne grew his brand as a horseback vigilante in decades' worth of Westerns, from his first leading role in 1930's The Big Trail to 1971's Big Jake, in which the law fails and Wayne's everyman is the only justice.

But as the classic The Man Who Shot Liberty Valance tells us, “This is the West, sir. When the legend becomes fact, print the legend.”

As the West developed, towns pushed this mythos of the West as their founding ideology. Lax gun laws were just a part of an individualistic streak that manifested itself with the explosion in popularity of concealed carry licenses and the broader acceptance of openly carrying firearms (open-carry laws) that require no permit.

“These Wild West towns, as they developed and became more civilized and larger, there was an effort to promote their Wild West heritage very aggressively, and that became the identity of the town,” says Winkler, “but that identity was based on a false understanding of what the past was like, and wasn't a real assessment of what places like Tombstone were like in the 1880s.”

So the orthodox positions in America's ongoing gun debate oscillate between “Any gun law is a retreat away from the lack of government interference that made this country great” and “If we don't regulate firearms, we'll end up like the Wild West,” robbing both sides of a historical bedrock of how and why gun law developed as America expanded Westward.