The Bill of Rights, Amendment Two, reads:
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.
The amendment relates back to The US Constitution, Article 2, Section 2/1:
The President shall be Commander in Chief of the Army and Navy of the United States, and of the Militia of the several States, when called into the actual Service of the United States…
The History of the US Army: the Early Years (copied from Wikipedia):
The Continental Army was created on 14 June 1775 by the Continental Congress as a unified army for the states to fight Great Britain, with George Washington appointed as its commander.
After the war, though, the Continental Army was quickly disbanded as part of the American distrust of standing armies, and irregular state militias became the new nation's sole ground army, with the exception of a regiment to guard the Western Frontier and one battery of artillery guarding West Point's arsenal.
However, because of continuing conflict with Native Americans, it was soon realized that it was necessary to field a trained standing army. The first of these, the Legion of the United States, was established in 1791 and disbanded in 1796.
For more information about the history of the US Army, please refer to the Wikipedia article found by searching the site for: US Army.
Until recently (excepting only two decisions by Chief Justice Robert’s Supreme Court) legal precedent has always considered, “Militia,” to mean part of the US military.