The town was founded by Novgorod traders at a point controlling the important portages between the Volga and Northern Dvina rivers. In 1147 a monastery was founded there. The town changed hands several times in the course of the 14th-century power struggles between Moscow and Novgorod, but it finally came under Moscow's control in 1478. The settlement grew rapidly as the main market for furs from the north and northeast and as a trade centre for goods transported between Moscow and Central Russia. The founding of St. Petersburg in the early 18th century led to Vologda's decline, but the town revived in the 19th century with the steady growth of the timber industry in the area and with the coming of the railway from Moscow in 1872. In 1898 the railway was continued to Arkhangelsk, and in 1906 Vologda was also linked by rail west to St. Petersburg and east to Vyatka (now Kirov).