Rakvere is a town in northern Estonia and the county seat of Lääne-Viru County, 20 km south of the Gulf of Finland. 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 in 18 February 1268.
On 12 June 1302, Rakvere was granted Lübeck rights. When the Danish king sold Danish Estonia to the Livonian Order in 1346, a large castle was built on top of the previous stronghold. The Ordensburg was protected by towers and courtyards. The building of a Franciscan monastery was started in 1508.