The Kajaani Castle was built on the Ämmäkoski island of the Kajaani river in the 17th century. The castle functioned as a administrative centre, a prison, and a military strongpoint. The most famous prisoner in the castle was the historian Johannes Messenius, who was forced to live in the poor conditions of the castle from 1616 to 1635.
Construction of the Kajaani castle began in 1604 and was completed in 1619. At first the castle only consisted of a stone wall, two round towers, and wooden buildings at the yard inside the castle.
Count Peter Brahe ordered a second construction stage of the castle, which was started in the 1650s and completed in 1666. During this construction stage, many wooden structures of the castle were replaced with stone structures to form a fortress.
During the Great Northern War (also known as the "Greater Wrath"), Russian forces sieged the castle for several months, until it was finally forced to surrender because of lack of food, firewood and ammunition. Shortly after this, the Russians exploded the castle and its inhabitants were transported to Russia to be imprisoned.
References:Inverness Castle sits on a cliff overlooking the River Ness. The red sandstone structure evident today was built in 1836 by architect William Burn. It is built on the site of an 11th-century (c. 1057) defensive structure. Today, it houses Inverness Sheriff Court.
The castle is said to have been built by Máel Coluim III of Scotland, after he had razed to the ground the castle in which Macbeth of Scotland according to much later tradition, murdered Máel Coluim"s father Donnchad I of Scotland, and which stood on a hill around 1 km to the north-east.
The first Inverness Castle was partially destroyed by King Robert I of Scotland and a replacement castle was sacked in the 15th century by the Clan Donald during the Siege of Inverness (1429). The castle was occupied during the Raid on Ross in 1491.
In 1548 another castle with tower was completed by George Gordon, 4th Earl of Huntly (1514–1562). He was constable of the castle until 1562.