A view of St. Peter's Basilica from Castel Sant' Angelo

St. Peter's Basilica as seen from one of the windows of Castel Sant' Angelo, also known as Mausoleum of Hadrian. At various points in history, Sant' Angelo was a tomb, a military fortress, and a prison. So what's the connection between the two structures?

Literally, the castle is connected to the basilica by a covered corridor called Passetto di Borgo. It served as a papal fortress for Pope Clement VII during the Sack of Rome in 1527.