In 1833, the Tolpuddle Martyrs founded the "Friendly Society of Agricultural Labourers". Trade unions were legal but because the members swore an oath of allegiance, they were arrested and tried in the Shire Hall. Beneath the courtroom are cells where the prisoners were held while awaiting trial. Dorchester Prison was constructed in the town during the 19th century and was used for holding convicted and remanded inmates from the local courts until it closed in December 2013. Plans have since been made to erect 189 dwellings and a museum on the site.