Built by Baron Robert d'Oilly the Elder in 1073, Oxford Castle was originally a wooden castle. By the 13th century, most of the castle's structures had been rebuilt in stone. It played a key role in defending the city from Saxon invaders and was significant during the Anarchy, serving as the base for Empress Matilda's campaign from 1141 to 1142.
Despite its advantageous location, Oxford Castle never became a royal residence for Henry I, who built the more regal Beaumont Palace nearby. By the time of Henry III, part of the castle had already been converted into a prison due to the obsolescence and impracticality of using the Norman medieval castle for military purposes. Like all prisons of that era, conditions were harsh, and prisoners were often hanged. Most inmates were poorer members of society driven to crimes such as theft and fraud out of desperation. The castle had been used as a prison since the 1200s but only officially became one in the 16th century.
During the English Civil War in the 1640s, up to 60 people were held in a single cell. The conditions were truly dreadful and almost inhumane.
From 1613 to 1785, the prison and castle belonged to Christ Church College, which leased the prison to jailers.
Most of the castle was destroyed during the English Civil War, and by the 18th century, the remaining buildings had become the local Oxford prison. A new prison complex with a tower used for public executions was built on the site in 1785 and later expanded in 1876.
Its status as a prison continued into the Victorian era, and in 1888 the castle was renamed HM Prison Oxford.
One of the most famous inmates held at Oxford Castle was Mary Blandy, an 18th-century murderer who poisoned her father with arsenic. She believed the arsenic was a love potion that would make him approve of her fiancé, a Scottish nobleman who was already married. She was hanged on April 6, 1752. It is said that her spirit still wanders the castle. During the 18th century, there were hundreds of hangings in the prison for crimes ranging from sheep theft to espionage. In the late 18th century, the prison governor and amateur archaeologist Daniel Harris made his prisoners participate in excavations on the prison grounds, during which a vaulted well and an 11th-century crypt in St. George's Tower were discovered.
In the Victorian era, children were often imprisoned. Julie-Ann Crumpling, the youngest inmate ever held at Oxford Prison, was only seven years old when she was sentenced to seven days of hard labor, allegedly for stealing a baby carriage.
The castle remained a prison until 1996, after which it was converted into a tourist attraction and a luxury boutique hotel with the Malmaison Oxford restaurant. Malmaison has a total of 95 rooms, many of which have been repurposed from prison cells in Wing A, as well as several in the Governor's House and correctional facilities located across the courtyard.
Sources:
http://shoffmire.blogspot.com/2014/04/oxford-castle-unlocked.html
https://www.atlasobscura.com/places/oxford-castle-prison
https://www.malmaison.com/locations/oxford/