Deadly mass shootings in the United States have occurred for years and a spate of shootings last year fueled the continuing debate over what can be done to stop such crimes in the country.

Proponents of gun control face a difficult roadblock, however: The Second Amendment.

The Second Amendment to the US Constitution states that "a well regulated militia being necessary to the security of a free state, the right of the people to keep and bear arms shall not be infringed."

History

Throughout much of US history, the amendment was hardly discussed. Passed by Congress in September 1789 and ratified in 1791, the Second Amendment was proposed in a political setting markedly different from that of the modern US.

Politics in the newly founded US were shaped by centuries of English tradition. The men of the US's founding generation feared a standing army could be used to oppress the people, as had occurred during the controversial rule of Oliver Cromwell, whom some regard as a military dictator who ruled England from 1653 until his death in 1658.

Instead of a standing army, groups of men in localities throughout the US were expected band together to form militia groups, which had their own weapons and received part-time, unpaid military training.

However, the US Revolutionary War showed that militias were not adequate to deal with invading forces such as those of the British Empire.

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

The issue was a matter of debate between two camps of influential men who framed the writing of the US Constitution: the Anti-Federalists and Federalists.

Federalists saw a strong, national government as necessary for the success of the newly formed US. The US Constitution was seen by the Federalists as a way of guaranteeing such a government.

Anti-Federalists wanted to block the ratification of the Constitution, claiming that a national government would be unable to address the needs of people far from the capitol.

While they were unsuccessful at blocking its ratification, the Anti-Federalists were instrumental in proposing 12 amendments to the Constitution which laid out inalienable rights for US citizens - 10 of which were ratified in 1791, including the Second Amendment.

Court precedents

While the Second Amendment was used to keep the federal government from regulating guns, states were left to regulate firearms as they saw fit. Many blocked black men from owning weapons and guns used for militias were kept on a government roll, according to the National Constitution Center, a historical organisation founded by the US government.

Still, the US Supreme Court (SCOTUS) has in recent years bolstered the amendment.

Modern debate over the Second Amendment's meaning and implementation first came to SCOTUS in 1939, with the case United States v Miller.

SCOTUS ruled in that case that the transportation of a sawed-off shotgun across state lines - from Oklahoma to Arkansas, this case - could be regulated by Congress under the National Firearms Act (NFA) of 1934, the first federal gun control act.

A protester holds a sign during a 'March For Our Lives' demonstration demanding gun control in Sacramento, California [Bob Strong/Reuters]

The NFA levied taxes but was also meant to curtail the sale of "shotguns and rifles having barrels less than 18 inches in length, certain firearms described as 'any other weapons,' machineguns, and firearm mufflers and silencers", due to their "frequent use" in crimes, according to the Bureau of Alcohol, Tobacco and Firearms.

That precedent lasted until 2008, when a near-total ban on firearm ownership in Washington, DC, passed by the federal government, was challenged.

SCOTUS ruled in a 5-4 decision that the history and language of the Second Amendment protected an individual's right to bear arms, not solely within a militia. The ruling struck down the ban.

The judges who disagreed wrote in their dissent that it was merely a nominal right of an individual and applied to "the right of the people of each of the several States to maintain a well-regulated militia" and that state governments should be able to decide when and if to ban guns in high-crime areas.

In 2010, a similar case involving a ban on handguns in Chicago, Illinois, was again struck down by a 5-4 decision. That case saw the majority agreeing that the 14th Amendment, ratified in 1868 to make former slaves US citizens and guarantees legal due process and that all citizen's fundamental rights will be protected, makes gun ownership a right, the National Constitution Center said.

However, there were still situations in which commercial firearm sales could be stopped, guns could be banned in sensitive areas such as schools, and a felon's right to own guns could be curtailed.

Lower courts throughout the US continue to see cases regarding the regulation of firearms. Even with the decisions of 2008 and 2010, these courts often disagree, according to the National Constitution Center.

Debate over the Second Amendment is far from over, in the public, political and judicial arenas.