The article focuses on the results of the archeological study, conducted on the ruins of the Fort 4, located in the territory of the medieval settlement Pirmeshki. The work was carried out in the context of the research of the fortification system Dag-bary, which had been a part of the Derbent defensive complex, erected during the reign of shahanshah Khosrov II Anushirvan (531-579) in the late 560s’. Judging by the remains of the walls, the fort had the internal dimensions of around 13,9 by 22,5 m with a wall thickness of 2 m. These parameters are very similar to the fort dimensions of the Mountain wall, which have better preserved. The revealed remains of the walls have the same constructive features as other fortifications of the Derbent defensive complex – double-shelled masonry of slabs of the same type, laid on wide and narrow sides without mortar, with backfilling of lime mortar. The complex of ceramic ware, presented in the cultural layers of the dig, belongs to the X – early XIII c. It can be assumed that the settlement and the forts in it ceased to exist in the period of the Mongol invasion to Dagestan, namely during the campaign of Jebe and Subutai in 1222, following the campaign of Bukdai in 1239. The data from written sources, and, mainly, Adam Olearius’ information, who visited Derbent in 1638, testifies to the destruction of numerous strongholds of the Mountain wall by the XVII c.