The Heller decision, the first Supreme Court ruling on the exact nature of the Second Amendment, ruled that the Second Amendment means exactly what it appears to say - that it protects an individual right to possess weapons, not a collective "right" to a state militia.
The Court first evaluated the "problematic" prefatory clause (The militia clause). First, the Court reviewed, briefly, the long-standing principle that statements of purpose cannot be used to restrict the underlying operative clause's function. And the militia clause itself actually referred to the practice of some English kings to selectively disarm disfavored groups of citizens, leaving them vulnerable to both the standing army and the remaining select militia loyal to the King. The opportunity to oppress large sections of the country represents a existential threat to a free state - a state in which the citizens are free. Seen in the actual context of the of the amendment at the time it was passed, it is clear that the amendment protects a personal right, and that the militia clause actually makes that more clear, not less. Otherwise, a state could selectively disarm, disenfranchise and oppress targeted groups of citizens in the same as the kings of England did with the select militia, eliminating a free state while still upholding the amendment.
The Court also pointed to the use of "The People" in other parts of the Constitution as making clear that "The People" in the Second Amendment meant the public, not the state. This included the First, Fourth, Ninth and Tenth Amendments, the Preamble and who elects members of the House of Representatives. All these uses of "The People" were held to mean the same thing.
The Court then addressed the phrase "keep and bear arms". The Court held, checking period dictionaries and common usage, that "arms" were not limited to military-grade weapons, but weapons generally, and especially all firearms. The Court then made a more extensive analysis of "keep and bear" . The Court concluded that "keep" meant, essentially "store at home" and "bear" meant, "carry on person." Both words were expressly found to not be exclusively related to militia service.
The Court also addressed the idiomatic phrase "bear arms against" (meaning "wage war") as a potential limiter to the nature of the Amendment. The Court rejected that argument on the grounds that "bear arms" only means "make war" when it includes the final word "against". The Court also addressed the dissent's other linguistic arguments, repeatedly showing that the arguments did not have a legal or historical basis.
The Court then took an extended historical look into how the right was interpreted by lower courts and legal scholars. The review clearly showed that the Amendment was generally held to be an individual right, in public understanding, from the Founding to beyond the post-Civil War period.
The dissent forms the core of its argument around US v Miller, a case where two men were convicted of transporting a sawed-off shotgun "in interstate commerce". The dissent claims that, because the Court in Miller focused their inquiry on the weapon's applicability to the militia, the Miller Court had that it was not an individual right. The Court today viewed the dissent as turning Miller on its head - the Miller decision was premised not on whether the men were part of a militia, but whether the weapon had use in a militia. The Miller Court actually presupposes that the right was individual, and so focused on whether the weapon qualified.
The Court also pointed out that the Miller Court only heard the prosecution side of the case. No representative appeared to argument the defense's case before the court.
Finally, the Court reviewed historical limitations of the right. Prohibitions of ownership by people who were genuinely dangerous - felons and the dangerously mentally ill, would be allowed to stand, as they existed when the Amendment was adopted.
The Court's ruling was as follows;
1) The Second Amendment protects an individual right
2) That right at least protects weapons in common use
3) Handguns are in common use
4) Some regulation and restriction is permissible
5) A total ban, like the DC handgun ban at issue goes beyond permissible limits and is unconstitutional.