The territory, like all the northern lands of Azerbaijan, was part of the Albanian state in the 4th century B.C. Mehran Gyrdyman from the dynasty of Sasanies even created his own kingdom at the territory. Albanian rulers Varaz Grigor and his son Djavanshir (616-681) were also from the dynasty of Mihranids. The Gyrdyman state was ruled by the most prominent ruler of Albania Djavanshir in 638–670. The ruins of the residence built by him on the Aghchay river 4 km from Talystan village is still famous as the Djavanshir tower.