early 15c., "contortion, twisting, distortion; a disorder characterized by contortion," from Old French torture "infliction of great pain; great pain, agony" (12c.), and directly from Late Latin tortura "a twisting, writhing," in Medieval Latin "pain inflicted by judicial or ecclesiastical authority as a means of punishment or persuasion," from stem of Latin torquere "to twist, turn, wind, wring, distort" (from PIE root *terkw- "to twist").
The meaning "infliction of severe bodily pain as a means of punishment or persuasion" in English is from 1550s. The theory behind judicial torture was that a guilty person could be made to confess, but an innocent one could not, by this means. Macaulay writes that it was last inflicted in England in May 1640.