The earliest information relating to a castle on the hill dates back to 1275. In 1329 Robert of Anjou entrusted the job of enlarging it to the Sienese sculptor and architect Tino di Camaino, who transformed the building into a palace for the king and for the court; it had a quadrilateral plan and two towers. In 1348 it was referred to in documents as castrum Sancti Erasmi, due to the presence on the site of a chapel dedicated to Sant’Erasmo. During the Spanish Viceroy period (1504-1707), the castle, which was called Sant’Ermo and then Sant’Elmo, was converted, following a design by Pedro Luis Escrivá, into a defensive fortress with a stellar plan, at the behest of the Viceroy Pedro de Toledo. The construction of the building in its present-day configuration, with a stellar plan, began in 1537 and in 1538 the epigraph was placed on the entrance portal, surmounted by the coat of arms of Charles V with the Habsburg double-eagle. Sant’Elmo was one of the most important castles of the Spanish Viceroy period. It housed a law court, and accommodated an art master and other officials. The residences for the castellan and other officers stood in the Piazza d’Armi, alongside the church of Sant’Erasmo and the storehouse where powder and ammunitions were kept. In 1547 Pietro Prato built the church, which was then destroyed in 1587 by lightning, together with the military quarters and the castellan’s house. Between 1599 and 1610 the castle was restored by Domenico Fontana. The church in the square, the castellan’s residence and the drawbridge were rebuilt. Many famous prisoners were incarcerated in the fortress, including Tommaso Campanella and, at the end of the eighteenth century, the patriots of the Neapolitan Republic, among whom were Gennaro Serra di Cassano, Giuliano Colonna di Stigliano, Ettore Carafa d’Andria, Mario Pagano, Ferdinando Pepe, Eleonora Pimentel Fonseca, and Luigia Sanfelice. After Garibaldi entered Naples, the Bourbon army abandoned the castle. On 9 September 1860 the Italian flag was raised. After that, Castel Sant’Elmo was used as a military prison until 1952. Following major restoration work, in 1982 the huge complex was handed over to the Soprintendenza per Beni Artistici e Storici di Napoli: only since then can it be said that Castel Sant’Elmo has legitimately become part of life in Naples, and the building is now used to host important exhibitions and events. From the castle battlements there is a magnificent view across the city.