By the 11th and 12th centuries, Baku had become a large commercial seaport on the Caspian Sea. For safety reasons, the Shirvanshah dynasty initiated a large-scale building project to strengthen the city’s fortification works. A fortress, protected with three rows of walls, was built around Baku, and also a deep moat was dug. Furthermore, additional defensive structures in a form of flag towers and small fortresses were built on the mountains that surrounded the city. All these towers and palaces made up a common defensive system for the city, which is located on the Absheron Peninsula today.
The beginning of the construction of the towers and castles dates back to the 11th and 12th centuries. These towers include the famous Maiden Tower, Sabail fortress, Ramana fortress, Mardakan fortress and Shikh fortresses. These fortresses were mainly occupied by military posts, which formed the city’s first line of defense in case of attack. In the 11th through 14th centuries, Baku was subject to attacks from the Seljuk Turks, Mongols and Russians. In 1175, the Shirvanshah ruler Akhistan, managed to prevent the occupation of Baku, with the help of the towers and fortresses existed by that time, by the Russians, who had arrived there with 73 ships. These towers, in addition to their defensive function, were used as communications facilities. When enemies were approaching the city, its defenders used to burn oil on the tops of the towers, thus warning the city about the danger.
One of the castles forming the defensive system of Baku was the Bayil Castle, now submerged almost completely under water. The fortress was built opposite the city in the 13th century in the Bayil Bay, but due to the earthquake of 1306 the water level there dramatically increased, and the fortress found itself deep under water. The castle was shaped like an irregular rectangle. It was surrounded by 1.5-m wide walls with 15 towers built along the perimeter. The fortress location was chosen so it could protect Baku from attack from the sea.
The Maiden Tower was also a part of the Baku’s defensive system, though whether this function was its main one, the scholars cannot say. The Maiden Tower is an 8-storey building resembling a cylinder. In the 18th through 19th centuries, the tower was used as a lighthouse.
In the town of Ramana, near Baku, there is another fortress from the 16th century – Ramana Fortress. It was built of white stone. The fortress height is 15 m. The Ramana Fortress was built by Shirvanshahs’ order for defensive purposes. According to documentary records, in the Middle Ages, there was an underground way running from the Ramana Fortress to the Maiden Tower.
In a town called Mardakan, also not far from Baku, there is another defensive fortress – the Mardakan Fortress, built in the middle of the 14th century by Shirvanshah Akhsitan’s order in honor of a victory over a defeated enemy. The fortress was used as a place for accommodation of a military post and as an observation post. The fortress’ height is 22 m.
The Shikh Fortress, or Ishyg Galasi (Light Fortress), is another defensive fortress located in the same village. This 16 meters high fortress was built in the year 1232 as an observation post.