Gravensteen was originally the prison of the Counts of Holland. The square tower is the oldest part of the complex, probably dating from the start of the 13th century. In 1463 the building was transferred to the city of Leiden, and served as a city prison. The building underwent a number of extensions in the 17th century.
From the gallery around the tower, sheriffs and magistrates had a good view of the execution site, popularly known as ‘pure sorrow’ or ‘the green turf’. The Gravensteen was ringed by a canal.