Rare term for a place of imprisonment or the punishment itself. In modern Japanese, 刑務所 (けいむしょ) is the standard word for prison, and 刑罰 (けいばつ) for punishment.
In old documents, the word 刑獄 is used to refer to a prison or punishment.
Compound of 刑 (けい, 'punishment') and 獄 (ごく, 'prison'). The exact historical derivation is uncertain, but the spelling is conventionally associated with the meanings of punishment and imprisonment.