When Omar Mateen embarked on his deadly rampage at a gay nightclub in Orlando early Sunday, he carried the same weapon used in some of the worst mass murders of recent times.

The AR-15, a popular military-style rifle, was used by Adam Lanza when he slaughtered 20 children and six adults at a Newtown, Conn., elementary school, in 2012.

AR-15s were also used in the killings at an Aurora, Colorado, movie theater that same year, as well as last year's ISIS-inspired terrorist attacks at a San Bernardino, Calif., government building.

"These are widely available in gun stores all across America. They're incredibly popular firearms among hobbyists and gun enthusiasts," says Adam Winkler, author of Gunfight: The Battle over the Right to Bear Arms in America, in an interview with NPR.

The AR-15 is not one specific weapon, but is used to refer to a category of semi-automatic firearms made by about 20 different manufacturers, with a lot of slight variations among them.

Such weapons were prohibited by Congress in 1994, but the ban expired a decade later, and since then their popularity has only grown, says Winkler, a professor of constitutional law at UCLA Law School:

"They've really caught on, just because of their military styling and because of their ease of use and customization. They're very highly customizable. You can put on your own component parts to it, take things out and easily put new things in. So some people have likened it to the iPhone of guns."

"These rifles' accuracy, reliability, ruggedness and versatility serve target shooters and hunters well. They are true all-weather firearms," says a Gun Owners of America website. "And, they are a lot of fun to shoot!"

Despite its popularity, the AR-15 is not widely used in violent crimes. The rifle's size makes it difficult to conceal, so most criminals tend to choose something smaller, like a handgun, Winkler says. Even most mass killings are carried out using other types of weapons such as handguns, he says.

"It doesn't make a lot of sense to bring that kind of firearm into a small space for shooting, because it's such a big firearm. It's harder to control," Winkler says.

Still, the AR-15 is popular with gun owners, in part because it's lightweight and easy to handle. Its long barrel generally makes it shoot more accurately, especially at great distances, and it tends to come with a high-capacity magazine, so critics see it as more lethal than smaller guns.

After Sunday's massacre in Orlando, the New York Daily News dubbed the AR-15 "the mass murderer's best friend."

Attorney Josh Koskoff, who represents the families of some of the Newtown victims in a lawsuit against gun manufacturers, says the slaughter in Orlando represents "more horrific evidence of the unique lethality of the AR-15. It is no wonder that this weapon was chosen by today's shooter, as it has been by so many before him and as it undoubtedly will be again."

The AR-15 can be purchased all over the country, although sales are regulated differently in each states, the Miami Herald reported:

"Some states have a magazine limit of 10 or 15 rounds. But in Florida, there are no general magazine capacity limits in terms of what you can own, but there are limits for certain uses such as for hunting certain animals."

Mateen bought his .223-caliber rifle legally, according to the Bureau of Alcohol, Tobacco, Firearms and Explosives. He also carried a 9-mm pistol.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.