“A well regulated Militia, being necessary to the security of a free State, the right of the people to keep and bear Arms when serving in the Militia shall not be infringed.”
"For more than 200 years following the adoption of that amendment, federal judges uniformly understood that the right protected by that text was limited in two ways: First, it applied only to keeping and bearing arms for military purposes, and second, while it limited the power of the federal government, it did not impose any limit whatsoever on the power of states or local governments to regulate the ownership or use of firearms."
-John Paul Stevens, former Justice SCOTUS
https://www.washingtonpost.com/opinions/the-five-extra-words-that-can-fix-the-second-amendment/2014/04/11/f8a19578-b8fa-11e3-96ae-f2c36d2b1245_story.html?utm_term=.80d8bb55fd0b