A shootout in the New York borough of Brooklyn this month had bystanders diving for cover and led to the death of Gov. Andrew Cuomo’s legal aide. Two television journalists were killed by a gunman while broadcasting in Virginia on August 28. These, and other, incidents — and the fact that murder rates are spiking in the United States after decades of decline — have put the issue of gun control back in the public spotlight.

Sounds just like the Wild West?

Not really.

Contrary to its name, the Wild West was the setting for the passage of some of the nation’s first gun-control laws. In 19th-century frontier towns, people couldn’t just walk around with guns in hand. Many Americans are probably unaware that the iconic Gunfight at the O.K. Corral, in Tombstone, Arizona, in 1881, arose because Deputy Marshal Virgil Earp was trying to enforce a city ordinance prohibiting anyone from carrying a deadly weapon in town.

Contrast that to today: This year it is projected that almost as many Americans (32,000) will be killed in firearm-related incidents as die in automobile accidents.

Not only has Congress failed to enact significant legislation to tackle the problem, earlier this summer, it extended limits on the Centers for Disease Control even researching the underlying causes of gun violence: to collect data, for example, on where killers get their guns.

Our nation’s lax attitude toward gun proliferation in American towns and cities is not the result of the unfolding of history. It seems, rather, that Hollywood’s version of cowboy culture and the fictional gunfighter has displaced the real historical record, as Richard Slotkin noted in his book “Gunfighter Nation” (1998), and had a powerful influence over public discourse about the place of guns in American society.

The 1953 movie “Shane” exemplifies the narrative of a “good man with a gun” — “an armed redeemer.” In the movie, responding to a woman’s wish that guns be banished from the valley, Shane replies: “A gun is just a tool, Marian. It’s as good or bad as the man that uses it.”

This notion is central to the National Rifle Association’s worldview, amplified through its bumper sticker and social media campaigns. But it is a classic — and tragic — example of what Oxford professor Margaret McMillan has called “bad history,” or picking out only a small part of a complex story, and burying the rest.

So let’s recall the real history of gun control, starting in the Wild West.

As legal scholar Adam Winkler explains in his book “Gunfight: The Battle Over the Right to Bear Arms in America” (2011), no gun-control law was more common in the late 1800s — on the frontier and elsewhere — than bans on concealed weapons. The first bans on possession of concealed weapons in public were adopted in Kentucky and Louisiana in 1813. Historian Clayton Cramer notes that “the South was decades ahead of the rest of the United States” in this regard.

Courts usually upheld the bans, with an Alabama court in 1840 declaring that the legislature was within its power to “suppress the evil practice of carrying weapons secretly.” The restrictions spread from the South to the frontier, and eventually led to the first court cases dealing with the constitutionality of gun control.

Leaders of frontier communities wanted to promote their towns and cities as safe places for settlers and commerce. As a Kansas newspaper editor put it, “People who have money to invest go where they are protected by law, and where good society and order reign.”

According to historian Robert Dystra, author of “The Cattle Towns” (1968), a visitor arriving in Wichita, Kansas, in 1873 would have seen signs declaring, “LEAVE YOUR REVOLVER AT POLICE HEADQUARTERS, AND GET A CHECK.” (A street sign in Dodge City, Kansas, in 1879 warned: “The Carrying of Firearms Strictly Prohibited.”)

At that time, there was a clear understanding that civilized people did not walk around America’s towns and cities carrying guns — and that on the American frontier, there were guns — and there was gun control. In fact, until recently, few seriously questioned that the Second Amendment applied only to keeping and bearing arms for military purposes.

On the contrary, the court unanimously held in the 1939 case United States v. Miller that Congress should prohibit the possession of a sawed-off shotgun because that sort of weapon had no reasonable relation to the preservation or efficiency of a “well regulated Militia.”

As the retired Supreme Court Justice John Paul Stevens explained last year in the Washington Post, “no judge or justice expressed any doubt about the limited coverage of the amendment” for the first 200 years after the Second Amendment was passed.

Fast forward to the 1980s, and laws liberalizing concealed-carry laws swept the land. Two profoundly important changes in the law occurred in 2008, when the Supreme Court decided in District of Columbia v. Heller that the Second Amendment protects a civilian’s right to keep a handgun at home for purposes of self-defense, and in 2010, when the court decided in McDonald v. Chicago that the due-process clause of the 14th Amendment limits the power of Chicago to outlaw the possession of handguns by private citizens.

In other words, our “gun industrial complex” is not the inevitable outcome of over two centuries of American gun-possession; it is the direct result of changes in the law and cultural attitudes that have occurred over the past couple of decades, as explained by the political scientist Kristen Gosse in her book, “Disarmed: The Missing Movement for Gun Control in America” (Princeton, 2008).

Where has all this gotten us?

Today, 36 states have adopted “shall-issue” laws that enable almost anyone with a clean record to get a permit to carry a hidden gun in public.

Texas allows unlicensed people to carry openly semi-automatic rifles in public places. Last June, Texas lawmakers passed a bill that would allow faculty and students to carry concealed handguns on university campuses. In May, the National Rifle Association fought the efforts of Oklahoma Gov. Mary Fallin to restrict guns at parks, fairgrounds and recreational areas. And with a proliferation of guns being kept in American homes — which is associated with a twofold increase in the risk of homicide — 2013 saw 1,670 children die by gunshot and an additional 9,718 injured.

One fact stands out: Guns might not kill people — but guns get people killed.
Gun owners could become more involved in setting of basic limits on the proliferation of firearms that would help reduce the numbers of deaths and casualties of firearm-related violence in America today. They should familiarize themselves with the true history of the American frontier, where gun restrictions were seen as conducive to a healthy nation.

And gun regulation advocates should make more of the fact that history is on their side.