One by one the harbours of ancient Ostia silted up, due to movements of the coastal sands and
river sediments, and its population abandoned the city in favour of a return to Rome.
By the C9th, to defend the important salt mines of the Via Ostiense from coastal raiders, Pope
Gregory IV created a new village of high-walled houses, protected by a surrounding ditch.
Thanks to a series of improvements (Martino V built a large tower and a moat fed from from the
River Tiber, which Giuliano della Rovere, Bishop of Ostia, widened in 1483, adding a gate house
with a look-out tower and the polygonal fortifications), for several centuries it constituted
the vanguard of Rome's defences against Saracen incursions - although an extraordinary flood in
1587 diverted the river, and robbed the moat of its water supply
Soon afterwards, developments in military technology saw the castle lose its purpose, and fall
quickly into ruin - being used as stables and storage by the few farmers and shepherds who
chose to remain in that malaria-infested area.
And it wasn't until the drainage of the Pontine marshes, in the early part of the 20th century, that the castle was restored to its present state.