Entrance to Fort McHenry in 1925 (Baltimore Sun / June 15, 2012)

The quickly constructed, earthen star-shaped Fort Whetstone, built in 1776, was the first fortification to occupy the site where Fort McHenry now stands.

The city's vulnerability to a waterborne attack was exposed in the spring of 1776 when the British sloop Otter sailed unchallenged up the Chesapeake Bay.

Baltimoreans quickly sprang into action, and the Maryland Council of Safety began to supervise construction of the fort on Whetstone Point, which was to include an 18-gun battery.

In order to keep out and frustrate any enemy ship trying to enter the harbor, three iron chains suspended by floating blocks of wood were stretched from the fort across the Patapsco River to Lazaretto Point.

A small passage was left open for friendly shipping to pass through (though to ensure their friendliness, they were required to sail directly under the battery's guns).

The feared British attack during the Revolutionary War never came, and by 1780, with the fort in decline, everything except the cannons and furniture was ordered sold.

When England declared war on France in 1793, the fort, which had remained under Maryland control, was turned over to the federal government.

The next year, Congress authorized and embarked on a massive program of constructing coastal forts along the Atlantic Coast to protect shipping and cities.

Maj. John Jacob Ulrich Rivardi had been appointed by Secretary of War Henry Knox to oversee construction of the present Fort McHenry, which began in 1794.

The fort was named for Marylander James McHenry, a signer of the Constitution and member of the Continental Congress who served as the nation's third secretary of war from 1796 to 1800.

The design of the pentagonal structure, which was completed by 1803, was the concept of French engineer Jean Foncin.

Secretary of War William Eustis wrote in 1811 that the fort was "a regular pentagon of masonry, calculated for thirty guns, a water battery, with ten heavy guns mounted, a brick magazine that will contain three hundred barrels of powder, with brick barracks for two companies of men and officers; without the fort, a wooden barracks for one company, also a brick store and gun house."

The fort's only trial by fire wasn't long in coming.

In 1812, the United States declared war on England, and two years later, after marching on and burning Washington, British forces turned their attention to Baltimore, where they attempted an invasion by land and sea.

A British flotilla of 50 warships rode at anchor off North Point, 12 miles from the city, on Sept. 11, 1814. As tensions mounted, Gen. Sam Smith, who was in charge of the defense of the city, made sure his force of 15,000 men was ready for the inevitable attack.

It was raining early Sept. 13 when a furious bombardment commenced. It was over by dawn the next day. The fort had held by virtue of its plucky band of defenders, and the British fleet was in retreat.

Its bravery and steadfastness inspired Francis Scott Key, who once described the War of 1812 as a "lump of wickedness," to pen what became "The Star-Spangled Banner."

The city had been spared, and it was the first and last time the fort's batteries would fire on an enemy.

The fort was abandoned by the federal government in 1860, and revived again with the outbreak of the Civil War.

During the Civil War, members of the state legislature and other Marylanders sympathetic to the Confederacy were imprisoned at the fort. After the Battle of Gettysburg, more than 7,000 Confederate prisoners were incarcerated there.