First attested in a medieval Turkic language in 11 century by Mahmud al-Kashgari. Appears to have spread to modern languages via Literary Chagatai.
Alternatively, may have been borrowed from or mediated by the Russianтюрьма́(tjurʹmá). Note, however, that the etymology of the latter is disputed between Turkic and Germanic.
Cognate with
Kazakh түрме(türme),
Kyrgyz түрмө(türmö),
Uzbek turma,
Turkmen türme, etc.