In 1483, under the pontificate of Pope Sixtus IV, the Bishop of Ostia Cardinal Giuliano della Rovere (the future Pope Julius II) began the construction of the Castle of Ostia, which was completed in 1486 under Pope Innocent VIII. The fortalice incorporated the pre-existing round tower, built in 1423-24 under Pope Martin V Colonna, which became the keep of the new building. The fortress served as the seat of the Papal Custom Houses, which regulated the payment of excise on goods arriving in Rome by sea.
Once ascended to the papal throne, Julius II (1503-1513) had important transformations made: a true papal apartment was built on the western side of the courtyard, by means of refurbishing some of the environments of the era of the Borgias. The three floors of the building were connected by a monumental staircase, frescoed, according to recent studies, by Baldassare Peruzzi with some collaborators, among them being the Lombard Cesare da Sesto.
At the end of the conflict between France and Spain, in 1556, the fortress of Ostia underwent a famous siege by the Spaniards, which resulted in no few damages to the structure. One year later, in 1557, after a sensational flood, the Tiber shifted its course to the present one. This caused the transfer of the Papal Custom Houses first to Tor Boacciana and then to Tor S. Michele.
In the 18th century the castle was used as a barn and then, in the following century, it became a prison for the convicts used as forced labour in the excavations at Ancient Ostia.
After several restorations made over the course of the 20th century, in 2003 an exhibition space was arranged in some of the rooms of the papal apartments and of the keep, in order to display the most significant part of the collection of late medieval and Renaissance ceramics, issuing from excavations carried out in the last century within the castle and the village.