Fort William and Mary was first constructed by the British in 1632 to defend the harbour at Portsmouth. On December 14, 1774, it was raided by locals led by John Langdon. The garrison of 5 men and one officer were easily overrun by Langdon's 40 volunteers who took 72 barrels of gun powder. A day later, another group of rebels, this time led by John Sullivan, again raided the fort taking all of the arms, supplies and some cannons.
By 1775, the British surrendered the fort and moved everything, including the Governor, to the relative safety of Boston.
In 1791, the fort and property were given by the State of New Hampshire to the Federal Government to protect Portsmouth, and the soon-to-be-constructed Portsmouth Naval Shipyard. The fort was rebuilt in 1800 for this purpose, doubling the height of the walls and adding additional buildings. Work was completed in 1808 when the fort was renamed Fort Constitution.
On July 4, 1809, celebrations were cut short by an explosion in which a number of soldiers and civilians were killed.
The fort was manned in 1812 and expanded to include a Martello tower by 1814.
By the Civil War, new granite walls were added to the fort, but with advances in warship technology and guns, they were already obsolete before being completed.
In 1961, the Federal Government returned the property to the State of New Hampshire and in 1973, it was added to the National Register of Historic Places.
There isn't a great deal of the original fort remaining today. It was small, even by the standards of the time, and history notes that it was almost more of a fortified storage dump than an actual defensive position. Fortifications have been added on the area surrounding the fort during the First and Second World Wars to protect the harbour that cover substantially more ground, but are fenced off, and completely off limits.