In the XI-XIII centuries in connection with the consolidation of the Shirvanshahs in the territory of the Apsheron Peninsula a great construction work was carried out. Among the buildings of that time the towers and castles hold a special place; they served as reliable strongholds for the feudal lords in the intestine wars, also as shelters and places of defense during the foreign invasions. Particularly this question was keenly raised in the XII century, when Apsheron was exposed to the attacks of the Russian buccaneers from the sea. Thus, in 1175 Shirvanshah Akhistan I repulsed several raids of the Russians, who attacked on 73 vessels. Located along the entire Apsheron Peninsula the towers were not designed for long stay in them. Unlike the West European castles of the same period the Apsheron castles did not have wide inner courtyards with habitable rooms and office buildings. Such kinds of buildings were situated beyond the fortress walls. The towers served just as temporary shelters for the feudal lords and their vassals during the attacks and for a passive defense. All the towers of Apsheron comprised the unified system of defense. In the XVII-XVIII centuries the towers played the role of a signal. While the enemy approached, oil was burnt on top of the towers and in this way, the population were warned against the danger. The towers of Apsheron have a lot of similar features. All of them are or were situated in the outskirts of the settlements or in general beyond them. Round and quadrangular towers of Apsheron have almost the identical planning in all cases. All of them are enclosed with quadrangular fortress walls. The courtyard side around all the towers made of stone walls is 20-25 m. In height, the towers are divided into tiers (from two to eight), connected with one another by the stairs as thick as a wall. There are no stairs to the second floor, portable wooden ladders were likely used. The first floor of all the towers is 6,5 – 7 meters in height, the upper floors – 3,5 –4,5 meters. The diameters of the round towers and the length of the sides of quadrangular towers (3,5 –5,5 m), the thickness of the walls (up to 2 m) are also close to one another. All the means of defense of the towers are concentrated on the upper square. Being placed on it the riflemen sheltered themselves by a stepped parapet with melons. The slot-like narrow openings widened inside on all the tiers of the tower except the ground floor, served mainly for lighting and ventilation. Their sizes did not allow using them for military actions; the zone for defeating was extremely limited. The primitive sewage lines – posts and wells with water also point to the fact that these towers served as temporary living quarters during the siege. Better preserved towers are in Ramana, Nardaran and two - in Mardakan, but the towers in Bilgah, Shagan and Gala are in ruins. Towers also existed in the settlements of Mashtagha, Shuvalan, Keshla, Hovsan, Buzovna and others. Thus, there were about 30 towers in the villages of Apsheron. The Quadrangular tower in Mardakan was erected in the XVI century. The dimension of the inner courtyard is 28X25m. The tower is 22 m high and has 5 tiers.