Above Armatix iP1 image by Ian Allen

Doug, who runs the website smartgunz.com, asks us not to use his last name or to identify the town where he works. “I’m just in Nebraska,” he says. “What’s on the website,” he continues, “that’s the information that can be given out. I just want to see where it’s going to go. Take baby steps. Move forward as it progresses.”

A lifetime National Rifle Association member, Doug earns his living as a gunsmith and licensed firearms dealer, selling pistols, revolvers, assault rifles, and machine guns to law enforcement and other qualified customers.

That’s all ho-hum. But smartgunz.com is sensitive stuff, so Doug wants to insulate his mainstream business from it.

Is he dealing in contraband? Peddling vice?

No. Doug is selling the Armatix iP1, a semiautomatic pistol developed by the renowned weapons designer and executive Ernst Mauch. During his more than 30 years with his prior employer, Germany’s Heckler & Koch, Mauch oversaw development of modern versions of the MP5 submachine gun, used by the FBI; the G36 assault rifle, used by numerous police forces; the GMG, a 40mm grenade machine gun used by about a dozen NATO armies; the Mark 23 pistol, used by U.S. Special Operations Forces and described by Small Arms Review as “the most reliable and accurate service pistol ever created”; and the HK416 assault rifle, reportedly used by a Navy SEAL to kill Osama bin Laden.

But Mauch’s iP1 pistol comes with a feature that’s found on no other weapon being sold in the world today. It’s supposed to prevent the gun from firing when anyone other than the owner—a child, say—pulls the trigger.

And that’s why Doug has to be so hush-hush. If his last name were made public, people would try to put him out of business and, perhaps, threaten to kill him. That’s what happened to the last two gun dealers who tried to sell this gun.

The iP1 is a so-called smart gun, also known as a “personalized” or “authorized-user-recognition” weapon. It shoots only if it is within 10 inches of a special watch, activated by the user with a five-digit PIN code for a set period—up to eight hours. The watch, which takes less than a half-second to activate, contains an RFID transponder, whose signal is recognized by a receiver inside the gun, which then unblocks the firing pin. (Doug sells the gun over the Internet to other licensed gun dealers, who can then resell it to retail customers in accordance with state law. He won’t say how many he’s sold, but he confirms he has sold some.)

GUN1-05-01-15-thumbnail

Click here to view “How to build a smarter gun”

Though no other smart gun is as far along as the iP1, there are a host of others in development. Some employ RFID, others use biometric sensors (like fingerprint readers), while still others are working on grip-recognition approaches—like the fictional gun James Bond used in the movie Skyfall.

A properly functioning smart gun holds out the prospect of eradicating, like smallpox, those unbearable horror stories we still come across about twice a month. Like the one last December, in which a 2-year-old at an Idaho Wal-Mart reached into his mom’s purse, pulled out her pistol, and shot her to death. (In 2010, 62 children, age 14 or younger, died in gun-related accidents, including 25 under the age of 5, according to the National Safety Council.)

Additionally, the hope is that smart guns could reduce the toll of murdered police officers, killed when their service revolvers are wrested away from them. (From 2004 to 2013, according to FBI statistics, 33 police officers were murdered with their own weapons.)

Likewise, some of the hundreds of despondent adolescents who use others’ guns to commit suicide each year — about 670 of them in 2010 — might be foiled long enough to find treatment. Criminals who steal handguns would make off with scrap metal. In theory, such technology could even keep U.S. military weapons from being used against us: If captured by enemy forces, the arms could be deauthorized and turn themselves off.

All intriguing prospects. So why would anyone try to put Doug out of business?

Well, there are some antigun groups that oppose smart guns for the same reason they oppose all guns. But they’re not the problem.

The problem arises, rather, from gun enthusiasts themselves, many of whom fear that smart guns are a step toward gun control, that the technologies are intrinsically unreliable, and that they are being foisted upon gun owners by ignorant do-gooders who aim to ban all guns that lack these features.

Such concerns are not pure paranoia. Some people really would like to make these guns mandatory. There are also some genuine technological hurdles to be overcome and some reasonable qualms to be set at rest. For a fingerprint-reading gun, can it be made to work with blood, mud, or gloves on your hands? For an RFID gun, like the iP1, what happens if you lose the watch, or an assailant grabs it away? For any smart gun, what happens if the batteries run out? And just how superior are smart guns to old-fashioned gun locks?

Officially, neither the National Rifle Association nor the main trade group for the domestic firearm industry, the National Shooting Sports Foundation, opposes smart guns. They oppose only “mandates,” each asserts—though it can sometimes be hard to tell from their rhetoric.

“Groups with no technical knowledge and who have a political agenda view this technology as a panacea,” says Larry Keane, general counsel of the NSSF. “It’s not as simple as they would like to make it,” he says. “There are significant challenges with marrying electronics and firearms. A gunshot generates a lot of energy and vibration. Guns require lubricants and solvents, which are hell on electronics.”

But resistance to smart guns clearly extends beyond technical issues. The most formidable opponent might be Keane’s client, the American gun industry. It’s a fairly small, low-margin business whose participants haven’t historically had to invest much in capital expenditures. The most popular pistols today are variants of one designed for Colt’s Manufacturing by John Browning in 1911. The entire industry generates about $8 billion in sales annually, which would place it 338th among the Fortune 500 if it were a company, about even with medical device maker Becton Dickinson. The largest handgun manufacturers, Sturm, Ruger, of Southport, Conn., and Smith & Wesson, of Springfield, Mass., had net sales of just $544 million and $627 million, respectively, in their latest fiscal years. For companies like these to shift to digital technologies would entail major financial upheaval.

Trade group reps, in fact, often speak as if no safer gun could possibly exist than those now in circulation. “A product that does exactly what it’s supposed to do, every time you do it, is safe,” proclaims Richard Patterson, the director of the manufacturer-run standards organization SAAMI (the Sporting Arms and Ammunition Manufacturers’ Institute). “It goes bang—not click, not boom. There are other people who define safety as a firearm that never goes bang.”

Gun trade group representatives also demean the iP1’s allegedly modest lethality. “That caliber is typically used for target shooting, plinking, and small game like squirrels,” says Keane, referring to the .22-caliber ammo it shoots. But Armatix has a 9mm pistol in the pipeline, the most popular pistol-bore size in the U.S., and one used by many police departments. That model, the iP9, is being designed to meet police and military specifications and should be available for evaluation by those forces later this year. If Armatix can persuade such a unit to adopt the iP9, the world will change.

“I’ve never been more optimistic about personalized guns than I am now,” says Stephen Teret, the founding director of the Johns Hopkins University Center for Gun Policy and Research, who has been pushing for safer gun designs for more than 30 years. “It’s going to happen. And the American gun companies can either get on board or they can become Kodak.”

In 2000, a product-liability suit was filed in Pittsburgh against the German gunmaker Heckler & Koch. A teenager accidentally killed his friend, another teen, with his father’s H&K P7 pistol. Ernst Mauch, then head of H&K’s technical operations, was required to testify.

Renowned gun designer and executive Ernst Mauch holds his smart-gun creation, the .22-caliber iP1.Photograph by Daniel Mayer

The son of a wheat farmer and honeybee keeper, Mauch grew up in Dunningen, in southwestern Germany. He completed a watchmaking apprenticeship while at a technical high school, and then, while earning a university degree in mechanical engineering, he fulfilled his practicums working at H&K in Oberndorf, 15 minutes from his home.

Upon graduation he became an H&K weapons designer, rising to head of its R&D unit in 1991 and head of all technical operations in 2001. In 2002 he became the first non-American citizen to be presented with the Chinn Award, a coveted annual honor conferred by a committee of the National Defense Industrial Association for significant contributions to the field of infantry weapons systems.

“Mauch listens to what the soldiers and Marines want,” says Dave Broden, who heads the NDIA committee that made the award, “comes up with creative ways to meet their objectives,” and “is great at drawing out the best in people, by building the right kind of collaborative team.”

If that honor was the pinnacle of Mauch’s career, the nadir may have been that product-liability suit, filed two years earlier. Testifying in a deposition via telephone, he was grilled for hours, as he remembers it. The questions were baffling to him at the time, he recounts in a telephone interview. (His English is good, but not perfect.)

“Look,” Mauch remembers testifying, “if a policeman needs to defend himself, the gun needs to fire. If a boy uses it, the gun doesn’t know. How would the gun know who handles it?”

Now 59, Mauch says he can’t remember the outcome of the lawsuit. But what’s “burned in my brain,” he says, is that an accident involving an H&K gun killed a boy. He remembers thinking, “Now it’s time to realize: Is it possible to get some intelligence in a gun to bring more safety?”

Then, in April 2002, a 19-year-old in Erfurt, Germany, shot 17 people to death at a high school. The massacre stunned the nation, which has strict laws governing gun possession and storage. In its wake, Bernd Dietel, who then co-owned the SimonsVoss electromechanical lock company, wondered whether his company could build a better gun lock. Seeking gun expertise, he reached out to H&K and was put in touch with Mauch.

In 2004, Dietel formed Armatix (pronounced AR-ma-tix in English, or ahr-MA-teeks in German) to make electromechanical gun locks. In 2005, Mauch left H&K, and in 2006 he joined Armatix, where he commenced work on a smart gun for the U.S. civilian market. (In late April, as this story was going to press, Mauch abruptly left the company under circumstances that are not yet clear.) The product would court a new category of gun buyer: young parents who wanted protection but feared having a firearm anywhere near children. A personalized .22-caliber pistol fit the bill. It was small and light, with minimal recoil—ideal for first-time gun owners.

No standards body, like Underwriters Lab, certifies the reliability of civilian guns. California and Massachusetts do require that a firearm, to be sold there, pass a shooting test. But they ask only that it fire 600 rounds with no more than six failures.

Mauch says the de facto industry norm for civilian handguns is around 5,000 rounds with no more than 50 failures. But at H&K and Armatix, he claims, he has hewed to a higher standard: no more than 10 failures in 10,000 firings. “We tested the iP1 with more than a quarter million rounds,” he says. “You can use it in rain, dust, and mud.”

The iP1 takes two AAA batteries, which will power about 5,000 firings, according to Armatix. An indicator light begins flashing when the batteries still have one-third of their life remaining — i.e., more than 1,000 shots. The watch takes a common button battery, and a watch-face icon monitors its depletion. If the battery is allowed to run out, the gun will not operate.

By mid-2013, Armatix had secured the federal and state approvals necessary to import its iP1 and sell it in all 50 states. It set the retail price at $1,798 — a price that the NSSF’s Keane calls “astronomical.” (Many handguns sell for about $600.)

Responds Mauch: “It’s up to people if they want to spend more money for more safety.” If the iP1 protects the life of someone’s child or grandchild, he says, that person may find the price reasonable.

Armatix then hired Belinda Padilla to head U.S. operations. Tall, slender, and plainspoken, Padilla is a former global sales director for AT&T. Her executive style is less Meg Whitman than Mona Lisa Vito, the Marisa Tomei character in My Cousin Vinny. She grew up in Los Angeles, but because of death threats doesn’t want additional personal details divulged.

Belinda Padilla, head of U.S. operations at Armatix.Photograph by Ian Allen for Fortune

“This would have been the solution at my house,” Padilla says of the iP1. Her father loved guns and kept a loaded revolver under the mattress. One day when she was about 7, she says, “my mom walked in and saw me and my sisters playing with the revolver, and when my dad got home it was like World War III.”

Padilla began looking for dealers. She thought she had found the perfect one when she met James Mitchell, the owner of Oak Tree Gun Club in Newhall, north of Los Angeles. Mitchell was excited about the gun, she says, and wanted exclusive sales rights for California. She declined, but gave him a right of first refusal, she asserts.

She moved her office to Oak Tree and set up a shooting range there where customers could try out her gun. The range, painted blue, with Armatix signage, featured the company’s unique Intelligent Range System. With this system, an iP1, when fitted with a simple add-on feature, will not fire unless pointed within the arc of designated targets. The safeguard protects customers from aberrant shots by novices and makes it nearly impossible for a shooter to commit suicide—a recurring hazard at ranges.

The day after Thanksgiving in 2013, scores of Oak Tree customers lined up to try the iP1 at her range, she recalls. (She showed Fortune photos of the event.) Nearly every customer, Padilla says, filled out a form, asking to be notified when shipments came in.

In mid-February 2014 the gun finally went on sale, she says. In a congratulatory email, an Oak Tree employee sent her a photo, Padilla says, depicting her gun tagged for sale in a display case.

On Feb. 17 the Washington Post ran a story about the landmark day, quoting Oak Tree’s Mitchell saying that the iP1 “could revolutionize the gun industry.”

Two or three days later, Padilla got a call from a friend, she recounts. “Belinda, your signs are all gone,” her friend said. Padilla drove to the club, and, sure enough, all Armatix signage had been taken down, her gun was no longer displayed, and her shooting range had been painted over green. “Like I never existed,” Padilla says.

Soon thereafter, Mitchell’s daughter Betsy told the online publication Gun Rights Examiner, “Our facility does not carry the Armatix pistol, never has, and [James Mitchell’s] comment was taken out of context … by the Washington Post.

His accuracy impugned, the author of the Post story, Mike Rosenwald, published a follow-up article, including a photo of the gun apparently on sale, along with additional quotations from his original interview with Mitchell.

Had the NRA gotten to Oak Tree? A spokesperson for the group told Fortune, “I’m always reticent to say, did the NRA contact such and such a person. In addition to 500 employees, there are 5 million–plus members.” He denied, however, that any of the group’s senior national officers contacted Oak Tree.

In a brief telephone interview with Fortune, Mitchell said, “That project is over with us.” Before getting off the phone he asserted that Oak Tree never sold the gun and added that a “person who worked for [Armatix] took a photo of it in the cabinet to make it look like it was on sale.”

Padilla declined to comment to Fortune about her conversations with Mitchell after the first Post article, saying she wanted to “keep things positive.”

A big clue to what had happened, though, can be gleaned from the Calguns.net website, which is still filled with angry posts from gun enthusiasts, many referencing a 13-year-old state law in New Jersey. To understand what that’s about, we need to step back.

GUN2-05-01-15-thumbnail

Click here to view “The big guns of the Mauch era”

Inventors first began patenting ideas for personalized guns in the mid-1970s. In 1994 the Justice Department commissioned a study of the concept as a possible way to reduce the number of “takeaway” killings of police officers—murders committed with the victim’s own firearm. At the same time, public health advocates began championing the idea too.

For most products, either the Consumer Product Safety Commission or a specialized agency, like the National Highway Traffic Safety Administration, can force implementation of safety features. That’s not true with guns. Congress withdrew the commission’s jurisdiction over guns in the mid-1970s. Gun lobbyists feared that gun-control advocates would ban guns through the backdoor by mandating unachievable safety features.

So proponents of smart guns turned to legislation and litigation to force the industry’s hand. In 1996, Johns Hopkins’s Teret and three faculty colleagues drafted a model law to mandate adoption of smart-gun technology. A New Jersey gun-safety group reached out to Teret for advice and then worked with state representative Loretta Weinberg of Teaneck to draft a law for New Jersey. In 1997 she introduced a bill, called the Childproof Handgun Act.

Under its provisions, once the state’s attorney general certified that a “personalized” gun was being sold anywhere in the U.S., the clock would start ticking, and three years later only personalized handguns could be lawfully sold in New Jersey.

At the time, Teret recalls, he felt that such a law would assure “manufacturers or tech people thinking of getting into gun safety that there might be a viable market for such a gun.”

In fact, a couple of manufacturers were manifesting interest. Bought out of bankruptcy by a forward-thinking investor group in 1994, Colt’s Manufacturing—bolstered with a $500,000 grant from the Justice Department in 1997—was developing a handgun that would work with an RFID-enabled wristband. At the same time, iGun Technology, a spin-off of O.F. Mossberg & Sons, was developing a personalized shotgun that employed an RFID-enabled ring.

For gun enthusiasts, however, the New Jersey bill confirmed their worst fears: Gun-control types really were trying to force these expensive, newfangled, unproven devices down their throats. A New Jersey NRA affiliate denounced Colt’s for “standing with … the antigunners,” as a 1999 Wall Street Journal article recounted, and later called for a boycott. Though the group backed down, one major Colt’s dealer suffered a 20% hit in sales of Colt’s products—$1.5 million.

Smart guns also played a cameo role in a massive litigation assault on the gun industry, patterned on the tobacco litigation. From 1998 to 2000 more than 30 municipalities sued the manufacturers seeking reimbursement of medical expenses for treating gunshot victims, and asking for reforms relating to gun distribution and design, including smart-gun technology. By 2000 the Clinton administration was threatening to pile on with its own suit against the industry.

That March, Smith & Wesson settled. Or, rather, tried to. It signed a deal with the White House, agreeing to a long list of reforms. Among other things, it would dedicate 2% of annual revenue to develop “authorized user technology,” which it would install “in all new firearm models within 36 months.”

Both the NSSF and the NRA caustically denounced S&W, with the NSSF asserting that it had “violated a trust with [its] consumers and with the entire domestic firearms industry.”

Other gun groups called for a boycott, and S&W was struck with a whopper. Sales fell sharply, two factories were temporarily shut down, and 125 of the 725 employees at its Springfield plant were laid off. S&W began backing away from the deal almost immediately, and when George W. Bush won the presidential election that November, the agreement collapsed. The following May, Tomkins, which had paid $112 million to buy the company in 1987, sold it for just $15 million, plus debt absorption.

By that time, the two manufacturers that had been pursuing smart guns most avidly—Colt’s and iGun—had each shelved their projects. “It was expensive to develop, we were a small company, and the idea met with limited enthusiasm from either side,” recalls Donald Zilkha, the investor who ran Colt’s at the time. Shotgun maker iGun got further, actually manufacturing 50 personalized shotguns between 1998 and 2000. But when it held a focus group on the idea, says company president Jonathan Mossberg, people kept saying, “I don’t want any damn circuit board in my gun.” (Recently, though, iGun has revived its business and is seeking orders.)

The matter was hardly over. In 2002, after a half-decade of legislative scrimmaging, New Jersey passed Loretta Weinberg’s smart-gun bill into law.

After the oak tree fiasco, Armatix’s Padilla looked for a new dealer. She was excited when she found Andy Raymond of Engage Armament of Rockville, Md., who was an Ernst Mauch buff. With his bulging, tattooed forearms and store full of assault-style weapons, Raymond was a gun guy to the bone. He believed that the iP1, by attracting a new category of gun owner to “our side,” would further the pro-gun cause, as he would later explain.

On May 1, 2014, shortly before he was to start selling the iP1, he gave a taped interview to MSNBC’s Chris Hayes. “It’s all about freedom,” Raymond told him. “So here’s the NRA — the bastion of great freedom — and they say this thing should be prohibited. How hypocritical is that?”

But before the Hayes clip could air, word got out, and the world came down on Raymond. He spent the night in his store, making sure it wouldn’t be burned down, as a telephone caller had vowed that it would be.

“Obviously I received numerous death threats today,” Raymond said in a video he posted on his Facebook page that night. “I really [expletive] appreciate that. That’s really [expletive] classy. Great thing for gun rights when you threaten to shoot somebody.”

The video—portions of which MSNBC’s Hayes later incorporated into his own revised segment—showed Raymond at his counter, smoking, a rack of assault rifles behind him, with a bottle of whiskey and a half-filled plastic cup near his right arm.

He would not be selling the iP1 after all, he said. “I believe my principles were correct,” he continued. “Unfortunately, maybe I was wrong. I don’t know. So the people of New Jersey, my apologies … If anything happens to me—if I resign or anything like that—I hope you don’t hold anything against my business partner or any of my employees.”

The ostensible bone of contention underlying the showdowns at Oak Tree and Engage Armament — the New Jersey law — quietly evaporated in November 2014, at least as to the iP1. The state’s acting attorney general ruled that he would not count the iP1 as “personalized” within the meaning of the act. (He reasoned that an unauthorized person could still fire it, at least temporarily, if he stole both an activated iP1 and the corresponding watch and held them together.)

In addition, after the Andy Raymond debacle, Weinberg—the original sponsor of the New Jersey law and now the majority leader of the state senate—publicly acknowledged that the time may have come to repeal her law. In an interview with Fortune, she says she expects some action before the end of this year. One possibility, she continues, would be to replace it with a statute that would simply require that if smart guns are available, New Jersey firearm dealers would have to offer at least one such model for sale.

The truth is, though, that the New Jersey law was never the whole issue. Many gun groups opposed smart guns before it was ever conceived. And even if it’s repealed, smart guns will still pose a threat to the gun industry. The NSSF’s Keane has candidly explained one reason on the group’s blog: “If a manufacturer were to overcome the significant technological challenges,” he wrote, “would they be exposing themselves to product-liability lawsuits alleging that all their other products that do not incorporate this technology are somehow ‘defectively designed’? … In our overly litigious society these are not merely theoretical liability concerns for product manufacturers.”

True enough. But what’s he suggesting? Is he signaling to his member companies that they should circle the wagons and freeze out these technologies?

“No, that’s not what I’m saying, and that’s not what that says,” Keane responds. “But as a lawyer who formerly represented manufacturers in product-liability lawsuits, I will tell you: If you put it on one model and have other models that don’t have it—for whatever reason—and that model gets involved in an accident, I assure you a plaintiffs lawyer is going to get an expert to say that that gun’s defective, because you coulda-shoulda put it on this gun. That is a reality of product-liability litigation in America.”

So, like gunsmith Doug somewhere in Nebraska, who started selling the iP1 in January, we’ll just have to wait and see if Americans buy these things, and if any American manufacturer will ever dare market one.

Mauch says he isn’t giving up.

“Think about it,” Mauch continues. “If your son would kill, with your gun, his best friend. It’s horrible. That happens. It happens very often. If there are other technologies available, we should not close our eyes.” 

This story is from the May 1, 2015 issue of Fortune magazine.