Today one of the U.S. Navy's most strategically significant seaports, Mayport's early history was fraught with military engagements, as control of the mouth of the St. Johns River was hotly contested. The first European to visit Mayport was the French naval officer, Commodore Jean Ribault, who landed at Ft. George in 1562. After establishing an outpost, the French were defeated in 1565 by Spanish forces from St. Augustine. The Spanish took advantage of a hurricane to attack by land and sack the French post while the French ships were foundering in the storm off St. Augustine.
The Spanish later built three forts in the area, most notably, "St. John of the Portal" near the mouth of the river, believed to be the source of the river's name. Spain retained jurisdiction of Florida until turning it over to Great Britain in 1763, and the British would rule for twenty years. Following the American Revolution, the treaty returned Florida to Spain, and the territory remained under Spanish control until it was ceded to the United States in 1820.