1810, "member of a gang of murderers and robbers in India who strangled their victims," from Marathi thag, thak "cheat, swindler," Hindi thag, perhaps from Sanskrit sthaga-s "cunning, fraudulent," from sthagayati "(he) covers, conceals," from PIE root *(s)teg- "to cover."
The more correct Indian name is phanseegur (from phansi "noose"), and the activity was described in English as far back as c. 1665. Rigorously prosecuted by the British from 1831, they were driven from existence by century's end. Transferred sense of "ruffian, cutthroat, violent lowbrow" is from 1839.