in 1524 Valmiera and its surroundings have been one of the longest-inhabited regions of Latvia. Archeological evidence indicates the site was inhabited 9,000 years ago. In 1224 after partition of
Tālava trade roads along the
Gauja river became property of
Livonian Brothers of the Sword who erected a castle which is today known as Valmiera Castle. After the
Battle of Saule in 1236
Valmiera Castle and nearby lands became the property of the newly established Livonian Order. Valmiera was first mentioned as a town in a chronicle dating back to 1323. The actual founding of the town probably occurred at least 40 years earlier when the master of the
Livonian Order Wilken von Endorp constructed a castle (
Wolmar) and
Catholic church on the banks of the river Gauja. Valmiera was a member of the
Hanseatic League from the 14th–16th centuries. Involvement in the Hansa brought significant trade and movement into the town's life. During the 14th–16th centuries several regional assemblies (
landtags) were held in Valmiera. After the
Livonian War in 1583 Valmiera was heavily devastated and was incorporated into the
Duchy of Livonia as part of
Wenden Voivodeship. After the
Polish-Swedish war in 1622 Valmiera was managed by the
Lord High Chancellor of Sweden Axel Oxenstierna. During the
Great Northern War Valmiera was again destroyed and burned down in 1702. It was further devastated by plague. During the first half of the 18th century Valmiera was on the decline. In 1738 M.E. von Hallart opened the first seminary of the
Moravian Church in Valmiera, a movement which played an important role in the history of Vidzeme. In 1785 Valmiera became the centre of a district. The town saw rapid development in the 19th century. First it was stimulated by the building of the first bridge over the river Gauja in 1865. Later the building of the Riga-St.Petersburg railway line through the town in 1899 also played a major role. Many new factories were built in the town and new settlements were growing on both banks of the river Gauja. During 1911–12 a narrow gauge railway line
Ainaži-Valmiera-
Smiltene was built thus making Valmiera a major transport hub. In 1906 Municipal elections were held and Valmiera was one of the few towns in Latvia where Latvians won the majority of seats (18 of 24). As a result, local doctor Georgs Apinis was elected as mayor. During the first quarter of the 20th century Valmiera also became a centre of culture and education as many schools were opened in the town. Among them were the Vidzeme teachers seminary, women gymnasium and merchant school. During
World War II, Valmiera was captured by troops of the
German Army Group North on 4 July 1941 and placed under the administration of
Reichskommissariat Ostland. In October 1941, 209 Jews from Valmiera and surrounding areas were murdered in local forests. The city was recaptured on 24 September 1944 by troops of the
3rd Baltic Front of the
Red Army during the
Riga Offensive. During the war almost all buildings at the center of Valmiera were destroyed. The
Cold War Liepas Air Base was located nearby. Version 2.2 of the open source mapping application
QGIS was named in honor of Valmiera. ==Development==