late Old English, prisoun, "place of confinement or involuntary restraint, dungeon, jail," from Old French prisoun "captivity, imprisonment; prison; prisoner, captive" (11c., Modern French prison), altered (by influence of pris "taken;" see prize (n.2)) from earlier preson, from Vulgar Latin *presionem, from Latin prensionem (nominative prensio), shortening of prehensionem (nominative *prehensio) "a taking," noun of action from past-participle stem of prehendere "to take" (from prae- "before," see pre-, + -hendere, from PIE root *ghend- "to seize, take").
In early use often "captivity, the condition of being in captivity or confinement;" hence, by extension, "a place for captives, a public building for confinement or safe custody of criminals and others committed by legal process," the main modern sense.