The AR-15 is perhaps the most ubiquitous firearm in American culture. The so-called “little black rifle” has become one of the most popular guns in civilian hands with an estimated four million AR-family rifles in circulation in the United States, according to statistics gathered by the Bureau of Alcohol, Tobacco and Firearms. From police tactical units to three-gun sport shooters; the AR-15 is ever present in America.

In spite of checkered service in Vietnam, a highly controversial acquisition process, and many attempts to replace it, the M16 — the AR-15’s military cousin — has endured as the primary-service small arm for over half a century; longer than any other U.S. infantry rifle. The AR has also courted controversy outside of the Pentagon; the rifle has been a target for gun-control advocates and legislators as it has appeared in mass shootings in Aurora, Newtown, and the Los Angeles Airport. But why has the AR-15 remained so popular? Part of the answer lies in its inherent design, but image has played an equal role.

The AR-15/M16 is often portrayed as the “gun of the good guys” through its use by U.S. and NATO forces. But it almost didn’t end up that way. After the American experience in Korea, where servicemen faced massed assault from Chinese forces, it was decided that the World War II workhorse M1 Garand rifle was no longer adequate; its low capacity and lack of full automatic fire hamstrung U.S. troops. The Pentagon wanted a new rifle. Around the same time, there was a push among NATO members to standardize a rifle caliber to simplify wartime logistics. American design philosophies dominated both, and the Army’s parochial Ordnance Corps dominated the discussion on design. Ordnance Corps officers clung to the popular myth of the heroic American rifleman, who wins the day with a few well-aimed, long-ranged shots from a full-power rifle.

Thus, the M14 was born, as well as the new NATO bullet, 7.62x51mm. But everyone soon discovered the difficulty of controlling full-caliber rifles on full-auto; 7.62 NATO weapons quickly turned into anti-aircraft guns in longer automatic bursts, rendering the feature ineffective. These experiences were supported by the results of Project SALVO, a Pentagon research project to develop next-generation infantry weapons. SALVO concluded that a smaller bullet traveling at high velocity would be as lethal, if not more so, than big calibers like 7.62 NATO; the SALVO report recommended that the Pentagon should adopt a little-known gun called the AR-15, designed by ArmaLite engineer Eugene Stoner, and based off his earlier file design for the AR-10.

Related: 10 odd weapons from U.S. military history.

The AR-15 was unlike anything seen before: It was constructed of forged aluminum and plastics, used a direct impingement gas operating system, and was chambered in the new 5.56X45mm cartridge. It was the antithesis of the M14. Naturally, the Ordnance Corps hated it, and moved to kill the project by resorting to testing practices and emulation that were ultimately unfair to the AR-15. The weapon languished in design committee as Army traditionalists butted heads with Robert McNamara and his RAND Corporation  “whiz kids.”

Pentagon politics entered the arena when Air Force General Curtis LeMay saw a demonstration of the rifle and came away impressed. When he became Air Force chief of staff in 1962, he moved to order 80,000 ARs for Air Force Security Forces. While this order was eventually canceled, the AR-15 still gained influential allies in the military industrial complex. Test samples were sent to U.S. advisors in South Vietnam who sent back reports raving about the weapon’s light-weight, gentle recoil, and supposedly astounding lethality. The weapon soon saw limited adoption by the Army as the XM16E1, the Air Force simply called it the M16. But the overly positive reports, the sales hype, and influence from powerful defense officials ignored the fact that the M16 was not necessarily the best-possible, American-made assault rifle; it was simply the first one. It was revolutionary, but it was not without serious flaws. These would tragically come to light as more and more Americans carried the rifle with them in Vietnam.

As American involvement in Vietnam grew, so did a feeling among troops there that something was seriously wrong with the M16. The weapon’s direct-impingement gas system increased fouling; this was compounded by the fact that a new type of powder used for the 5.56 round also increased fouling. The gun lacked a chromed bore and chamber, a common feature on previous U.S. rifles designed to protect against rust.

Magazines caused failures to feed. Thus, M16s in combat condition experienced an inordinate amount of malfunctions. Troops lacked proper cleaning and maintenance training; in some cases, they weren’t even issued basic cleaning kits. They liked the M16 when it worked, but when it didn’t, it was often getting them killed. Colt Firearms, who now owned the AR-15 design, insisted that the M16 was “self-cleaning” and that user error was to blame. Pentagon officials also claimed that the complaints regarding the M16 were from a small minority of service members. But eventually, the M16’s proponents couldn’t ignore the growing dissent, which in 1967, went public. Congressional investigations were launched, demanding to know why the M16’s issues weren’t being addressed. Under this pressure, a number of changes were made, including the overlooked chromed chamber. Additional training was provided, including a comic book from famed cartoonist Will Eisner. Reliability issues declined, but the early experience with the M16 in Vietnam has saddled the M16 with a bad reputation, despite the track record of modern variants of the rifle. For those not immersed in U.S. gun culture, the M16 is “that gun that jams all the time.”

In the post-Vietnam era, there were several attempts to replace the M16 family of weapons, but none succeeded. So after over 50 years in service, the AR-15-style rifle has firmly achieved the perception of itself as the weapon of U.S. democracy and as the product of American technological superiority. Despite being so old, the rifle seems to have held on to its futuristic looks. It remains one the more ergonomic weapons in use today, as its safety and firing controls can be used one handed. And the 5.56mm round still appeals to a wide variety of shooters due to its mild recoil.

And due to the way the Bureau of Alcohol Tobacco and Firearms regulates AR-15s, the rifle’s configuration is easy to change. The ATF considers the lower receiver of the AR-15 to be the actual licensed firearm; most everything else is considered to be just parts. Given the rapid disassembly of the AR-15, owners can swap upper receivers quickly to suit their needs. Many of the parts are easily changed from the stock to the handguards. This LEGO-style customization not only allows the AR-15 to remain a modern rifle, but enables a sense of individual design. Additionally, in the past 16 years, there’s been huge growth in the number of companies building AR rifles, parts, and accessories. Today’s tricked out AR-15s also appeal to gun enthusiasts who want to use what the professional use. ARs are the rifle of choice for special operations units, police SWAT teams, competitive shooters; that elite caché has influence on what guns are bought by the general public.

The AR-15’s immense popularity has thrust it to the forefront of the American gun control debate. The rifle was a target for the 1994 Federal Assault Weapons Ban, and several states specifically mention it by name in their own assault weapon laws. Legislators focused on the cosmetic features of semi-auto rifles like the AR-15 (by this point, transfer of full-automatic weapons to civilians was prohibited), and largely ignored rifles with a less “militaristic” appearance.

And as mass shootings dominate national headlines, the AR-15 keeps appearing in the hands of the perpetrators. Throughout the negative coverage of the AR-15, one question remains to be answered: Do mass shooters equip themselves with AR-15s because they are familiar with its advantages, or due to it being the most popular rifle in America? Whatever the answer, the AR-15 has weathered every controversy so far; and despite the production of new rifles for military and civilians, the little black rifle isn’t going anywhere.