Alinja is a 2000-year-old fortress located to the west of Khanega village in the Nakhchivan Autonomous Republic, an exclave of the Republic of Azerbaijan. The fortress was constructed by the Armenian lords of Syunik, the ninth province of the Kingdom of Armenia between 189 BC and 428 AD. It served as the Armenian fortress of Yernjak until the 12th century. Then, the Turkic dynasty of Ildegizids, also known as the Atabegs of Azerbaijan, took over the structure.
Due to the topographic and structural similarity, the Alinja Fortress is also called the Machu Picchu of Azerbaijan.
Nakhcivan is a semi-desert region that is rather mountainous. Therefore, it is unsurprising that one must climb over 1600 steps to reach the fortress. Due to its isolated location, the Book of Dede Gorgud, the legendary 15th-century epic poem of the Oghuz, describes it as a highly strong fortification. Built during the 1140s under the rule of Eldegyz, the fortification walls faced the greatest challenge against the troops of Teymur in the late 14th century. Alinja managed to resist the siege for 14 years.