Most of the castle was destroyed in the English Civil War and by the 18th century the remaining buildings had become Oxford's local prison. A new prison complex was built on the site from 1785 onwards and expanded in 1876; this became HM Prison Oxford.