The earliest signs of human settlement dating back to the 3rd–5th centuries AD have been found on the present theatre hill. Probably to protect that settlement, a wooden stronghold was built on the present Vallimägi. When it changed owners in 1220, the Danes started to erect buildings from stone. A settlement called "Tarvanpea" was first mentioned in the Chronicle of Henry of Livonia in 1226. The new Danish stronghold was called "Wesenbergh" in Middle Low German for the first time in 1252. The battle of Wesenberg between the Danish and German knights and Russians occurred nearby on 18 February 1268.