The Castillo de San Marcos is a Spanish fort that was built to keep anyone, especially the English, from taking control of St. Augustine, and thusly, Florida. It is the oldest masonry fort in the United States, and it was built in 1672. On the edge of St. Augustine, on the west bank of the Matanzas Bay, it replaced nine successive wooden fortifications that had protected the city since it's founding in 1565. It is a huge fort that faces, and protected both the sea and the inland city of St. Augustine.
It is surrounded by a moat that was kept dry and used at times to keep domestic animals penned. At other times , when under land attack, it could be filled with sea water by opening certain flood gates. The four corners of the fort each have a diamond-shaped bastion that was equipped with a cannon and each was positioned so as to create a crossfire with other cannons.
No one lived in the fort, well, almost no one. The troops lived in town with their families and came to fulfill their stints at guard duty, which usually lasted 24 hours. They then slept and prepared their meals in rooms with large fireplaces which also battled the elements of winter. Even in Florida, it gets cold.
Many battles ensued here, the first of which was during the War of the Spanish Succession in 1702, when the English burned the town but could not infiltrate the fort. Afterwards, the Spanish built new earthen walls around the city itself, making it a walled city. Attacked again by the British under Gen. George Oglethorpe, in 1740, they were beseiged for 27 days, but to no avail.
After all those years of fighting, Spain ceded Florida to the British as a result of the Seven Years' War. In return, the Spanish were given La Habana, Cuba. The British held the fort until the Treaty of Paris in 1783, which ended the American Revolution, and returned Florida to Spain. In 1821, it was ceded to the United States and renamed Fort Marion. The Castillo de San Marcos was last used as a military prison during the Spanish-American War.
In 1924, both it and Fort Matanzas were named National Monuments and in 1942, the original name, Castillo de San Marcos, was restored. Today it is open to the public, who ironically has done more damage to it, than all the wars combined (not intentionally, just due to the heavy foot traffic of thousands of people each year.)
Source: My own trip and the National Park Service Brochure.