The tomb of the Roman emperor Hadrian, also called Hadrian's mole, was erected on the right bank of the Tiber, between AD 134 and 139. Originally the mausoleum was a decorated cylinder, with a garden top and golden quadriga. Hadrian's ashes were placed here a year after his death in Baiae in 138, together with those of his wife Sabina, and his first adopted son, Lucius Aelius, who died in 138. Following this, the remains of succeeding emperors were also placed here, the last recorded deposition being Caracalla in 217. The urns containing these ashes were probably placed in what is now known as the Treasury room deep within the building. Hadrian also built the Pons Aelius facing straight onto the mausoleum – it still provides a scenic approach from the center of Rome and the left bank of the Tiber, and is renowned for the Baroque additions of statues of angels holding aloft instruments of the Passion of Christ.
Much of the tomb contents and decorations have been lost since the building's conversion to a military fortress in 401 and its subsequent inclusion in the Aurelian Walls by Flavius Honorius Augustus. The urns and ashes were scattered by Visigoth looters during Alaric's sacking of Rome in 410, and the original decorative bronze and stone statuary were thrown down upon the attacking Goths when they besieged Rome in 537, as recounted by Procopius. An unusual survivor, however, is the capstone of a funerary urn (probably that of Hadrian), which made its way to Saint Peter's Basilica, covered the tomb of Otto II and later was incorporated into a massive Renaissance baptistery. The use of spolia from the tomb in the post-Roman period was noted in the 16th century – Giorgio Vasari writes:
...in order to build churches for the use of the Christians, not only were the most honoured temples of the idols [pagan Roman gods] destroyed, but in order to ennoble and decorate Saint Peter's with more ornaments than it then possessed, they took away the stone columns from the tomb of Hadrian, now the castle of Sant'Angelo, as well as many other things which we now see in ruins.
Legend holds that the Archangel Michael appeared atop the mausoleum, sheathing his sword as a sign of the end of the plague of 590, thus lending the castle its present name. A less charitable yet more apt elaboration of the legend, given the militant disposition of this archangel, was heard by the 15th-century traveler who saw an angel statue on the castle roof. He recounts that during a prolonged season of the plague, Pope Gregory I heard that the populace, even Christians, had begun revering a pagan idol at the church of Santa Agata in Suburra. A vision urged the pope to lead a procession to the church. Upon arriving, the idol miraculously fell apart with a clap of thunder. Returning to St Peter's by the Aelian Bridge, the pope had another vision of an angel atop the castle, wiping the blood from his sword on his mantle, and then sheathing it. While the pope interpreted this as a sign that God was appeased, this did not prevent Gregory from destroying more sites of pagan worship in Rome.
The popes converted the structure into a castle, beginning in the 14th century; Pope Nicholas III connected the castle to St Peter's Basilica by a covered fortified corridor called the Passetto di Borgo. The fortress was the refuge of Pope Clement VII from the siege of Charles V's Landsknechte during the Sack of Rome (1527), in which Benvenuto Cellini describes strolling the ramparts and shooting enemy soldiers.
Leo X built a chapel with a Madonna by Raffaello da Montelupo. In 1536 Montelupo also created a marble statue of Saint Michael holding his sword after the 590 plague (as described above) to surmount the Castel. Later Paul III built a rich apartment, to ensure that in any future siege the pope had an appropriate place to stay.
Montelupo's statue was replaced by a bronze statue of the same subject, executed by the Flemish sculptor Peter Anton von Verschaffelt, in 1753. Verschaffelt's is still in place and Montelupo's can be seen in an open court in the interior of the Castle.
The Papal state also used Sant'Angelo as a prison; Giordano Bruno, for example, was imprisoned there for six years. Another prisoner was the sculptor and goldsmith Benvenuto Cellini. Executions were performed in the small inner courtyard. As a prison, it was also the setting for the third act of Giacomo Puccini's 1900 opera Tosca; the eponymous heroine leaps to her death from the Castel's ramparts.
Decommissioned in 1901, the castle is now a museum: the Museo Nazionale di Castel Sant'Angelo. It received 1,234,443 visitors in 2016.