The town was founded in the 17th century, fuelled by the growth of the tar industry, but it was preceded by a long history of settlements. During the Great Northern War it succumbed to Russian forces, who ruined Kajaani Castle in 1716. Today, the local economy is mainly driven by the sawmill, lumber, and paper industries, although UPM Kymmene's paper mill, the main employer from 1907 until 2008, has since closed. Kajaani's church was built in 1896 in the Neo-Gothic style by the architect Jac Ahrenberg to replace an earlier church. Kajaani's town theatre was established in 1969.