Castel Sant'Elmo's history began in the 13th century, evolving from a 10th-century church site into a medieval fortress and military outpost built by Roberto d'Angiò in 1329. Its structure was later transformed into its current star-shaped design by the Aragonese rulers in the mid-16th century, and it has since served as a military prison until 1952, before being restored and opened to the public in 1982.