Rakvere is a town in northern Estonia and the administrative centre of the Lääne-Viru maakond (county), 20 km south of the Gulf of Finland of the Baltic Sea. Rakvere is the 8th most populous urban area in Estonia. Rakvere has a total area of 10.75 square kilometres, and although about 15% of Rakvere is covered by forest, it is still the country's third most densely populated urban area. From the 13th century until the early 20th century, Rakvere was more widely known by its historical German name, Wesenberg(h). 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-day Vallimägi. Soon after the kingdom of Denmark had conquered northern Estonia, in 1220, the new rulers started to erect stone buildings. A settlement called Tarvanpea was first mentioned in the Chronicle of Henry of Livonia in 1226. The new Danish stronghold got the first recorded mention as Wesenbergh (in Middle Low German) for the first time in 1252. The battle of Wesenberg between the Danish and Teutonic knights and local militia on one side and the forces of Novgorod and Pskov on the other occurred near Rakvere on 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. During the wars of the 16th century, Rakvere was in 1558 captured by Muscovite troops and heavily damaged after the disastrous Siege of Wesenberg (1574) by Sweden. Sweden captured the town in 1581 before it passed to the Polish–Lithuanian Commonwealth in 1602; Polish troops destroyed the castle in 1605. After being returned to Swedish control in that year, a mansion was built on the ruins of the monastery. During the Great Northern War, Rakvere was burned down in 1703.