41. At the same time Qizil Arslan occupied all the land of Shirvan lying between Shamakha and Derbent. 42. The Erivan Fortress had three gateways on its double line battlements : Tabriz, Shirvan and Korpu. 43. In 1725 Surkhay-khan I received the title of khan of Shirvan and Kazi-Kumukh. 44. General Nader sent his messenger to Surkhay-khan I of Shirvan and demanded him to leave. 45. He married a Georgian princess while the khanates of Shirvan and Georgia were both parts of Persia. 46. In 1032, an combined army from Sarir and Alania invaded Shirvan and seized its capital Shamakhi. 47. In the XVI-XVII centuries the area was an'ulka'of the Shirvan Khanate. 48. In the early 16th century the kingdom of Shirvan was conquered by Shah Ismail of the Safavid dynasty. 49. Surkhay-khan I, Ahmed-khan and Nutsal of Avaria ransacked Shirvan for one whole year. 50. During their withdrawal from Shirvan , however, they were attacked and defeated by the people of Derbent.