A fortress called Varberg (at that time written Wardbergh, "watch hill") was erected in the 1280s as part of a chain of military establishments along the coast, in what was then Danish territory. In the middle of the 14th century, the old settlement "Getak�rr" 1 km north of the fortress took its new name from the fortress. The town was moved 5 km northwards around the year 1400. It was destroyed in the beginning of the 17th century and rebuilt near the fortress. In 1645 Halland passed from Denmark to Sweden by the Treaty of Br�msebro for a period of 30 years. It had at that time about 600 inhabitants. The transfer was made permanent by the Treaty of Roskilde in 1658. The town was moved again after a fire in 1666, to the location were the city centre is today. The city was devastated by a huge fire in 1863 and was subsequently rebuilt with stone or brick houses. In 1890 the population figure had passed 4,000 and with industrialization it reached 8,500 in 1930. The local government reform of 1971 made Varberg the seat of the much larger Varberg Municipality, with a current population of close to 56,000 inhabitants. Although several houses were torn down in the 1970s, most of the city center still remains intact