Image copyright Getty Images Image caption Semi-automatic AR-15 guns for sale in Utah

It's one of the most divisive issues in American society, once again brought to the fore because of a deadly mass shooting.

So what is the basis for the right to bear arms? And what key events have helped shape the debate?

The very beginning

15 December 1791

It makes sense to start with the date the Second Amendment to the US constitution was ratified. Here, 27 simple words set the path to gun ownership in the US.

"A well regulated militia, being necessary for the security of a free state, the right of the people to keep and bear arms, shall not be infringed."

The fact that the sentence does not make grammatical sense has only added fuel to the debate about what its true meaning is.

Is the key part "a well regulated militia" - meaning that only people who belong to a militia should be armed? And if so, what constitutes a militia in the modern day? In 1791 it represented a group that armed itself against the British army.

Is the key part instead "the people"? And if so, who are "the people"?

It's clear which part of the amendment gun enthusiasts see as most relevant - a sign in the lobby of the National Rifle Association (NRA) Museums in Virginia cuts off the first 13 words and says only:

The Revolt at Cincinnati

21-22 May 1977

Media playback is unsupported on your device Media caption Why the NRA wields so much power

The NRA today is a powerful pro-gun lobbying group that fiercely resists gun control efforts and says it has five million members.

It wasn't always the case.

The organisation was co-founded by a former New York Times reporter, William C Church, in 1871 to "promote and encourage rifle shooting on a scientific basis".

It was set up by former Union soldiers who fought in the Civil War who had been shocked at the poor level of marksmanship of their fellow Union fighters compared with their Confederate rivals (its first president was Gen Ambrose Burnside, whose facial hair inspired the term "sideburns").

Image copyright Hulton Archive/Getty Images Image caption Gen Ambrose Burnside and his sideburns

Much of its activity before the late 1970s involved hunting and organising shooting competitions.

But a shift began to happen in the 1960s and 70s due in part to rising crime rates and a growing conservative movement, at the time the NRA was keen to move away from lobbying.

"An increasing proportion of members were buying guns for self-protection," Adam Winkler writes in his book Gunfight: The Battle Over The Right To Bear Arms In America. "The leadership of the NRA didn't understand the importance of this shift and decided that the organization should recommit itself to hunting and recreational shooting."

The result was that during the NRA's annual meeting in Ohio, more conservative elements of the group staged a surprise coup in what's become known as The Revolt in Cincinnati.

They were led by Harlon Carter, the head of the NRA's lobbying arm who had once been jailed for shooting dead a Mexican teenager. After a fraught meeting that lasted until 04:00, the NRA's leadership was voted out and the group's new direction as a fierce opponent to gun control was set.

What are an individual's rights?

26 June 2008

Image copyright AFP/Getty Images Image caption Dick Heller, the security guard who helped make history

One of the most significant recent developments in recent US gun law came thanks to a security guard in Washington DC.

The district had some of the strictest gun control laws in the US, barring individuals from keeping a gun in the home. But Dick Heller wanted to be able to take his work gun home to the high-crime area in which he lived.

His case - backed not by the NRA but by a group of libertarian lawyers - went all the way up to the US Supreme Court.

The debate focused closely on what those 27 words in the Second Amendment meant in a 21st Century context. Is it OK for an individual to own a gun if they're not technically in a militia?

Five of the justices thought the DC law should be struck down, and four dissented. A whole new interpretation of the Second Amendment was drawn.

In his majority opinion, Justice Antonin Scalia wrote: "There seems to us no doubt, on the basis of both text and history, that the Second Amendment conferred an individual right to keep and bear arms."

"This is a great moment in American history," NRA chief Wayne LaPierre said after the ruling on 26 June 2008. "Our founding fathers wrote and intended the Second Amendment to be an individual right. The Supreme Court has now acknowledged it."

While gun sales had already been on the rise in the US for some time, they started to increase significantly in the wake of the DC vs Heller case - in the month the ruling was made, almost 820,000 FBI background checks were conducted; in the same month a year later, there were almost 970,000.

It's worth noting though that the Supreme Court added some caveats.

Justice Scalia wrote: "Like most rights, the Second Amendment right is not unlimited. It is not a right to keep and carry any weapon whatsoever in any manner whatsoever and for whatever purpose."

The court's opinion, he said, did not mean "longstanding prohibitions", such as "the carrying of firearms in sensitive places such as schools and government buildings" were now lifted.

#NeverAgain?

14 February 2018

Media playback is unsupported on your device Media caption US students walk out to demand firearms control

Only time will tell whether the shooting at the Marjory Stoneman Douglas high school in Parkland, Florida, is a true turning point in the debate about guns in the US.

But it helped galvanise a new gun control movement driven by young people - one that is not necessarily calling for an end to guns, but for compromise and change.

Students who survived the attack that killed 17 people have demanded an end to gun violence in schools.

Their pleas helped bring about a federal ban on "bump stocks", modifications that enabled semi-automatic rifles to shoot more rounds per minute. And Parkland survivors continue to be some of the most prominent young voices for change on gun regulation.

Media playback is unsupported on your device Media caption Seven things the NRA blames after Florida

Other mass shootings have led to change in some states.

After the killing of 26 people in Sandy Hook Elementary School in Newtown, Connecticut, in December 2012, some states enforced better background checks (the Law Center to Prevent Gun Violence, however, said more states loosened gun restrictions in the year after the attack).

When 58 people were shot dead in Las Vegas in October 2017 - the worst mass shooting in modern US history - Massachusetts banned bump stocks.

So what may happen now?

"In Newtown, the students were so young they couldn't stand up, but trust me - we are going to be the change," Parkland survivor Alex Wind told the BBC.