dungeon
DUHN-juhn · noun
Origin
Dungeon comes from Middle English dongeoun, from Anglo-Norman and Old French donjon, meaning the keep of a castle — its central, dominant tower. That in turn traces to Vulgar Latin *dominiōnem, likely related to Latin dominus, "master, lord," as if the keep were the "dominant building."
Journey
In Anglo-Norman, the keep of a castle came to also mean a prison kept within it, a sense never attested in continental Old French. This shift likely happened alongside Old English dung, "underground prison cell," whose related Middle English form donge also meant "pit, abyss" — meanings that blended into dongeoun and pulled the word downward, from the top of the castle to its depths.
Related words
Dungeon is a doublet of donjon, the very word still used in English for a castle's keep — two forms of the same word that split to describe the top and bottom of the same building.