Alinja (also known as "Alıncak"; Azerbaijani: Əlincə; Armenian: Երնջակ, Yernjak) is a village and municipality in the Julfa Rayon of Nakhchivan, Azerbaijan. It has a population of 634. The mausoleum and shrine of the Hurufi Fazlallah are located on a hillside overlooking the village. Qara Iskander, the ruler of Kara Koyunlu was murdered there in 1436 by his son Shah Kubad.
The seventh century atlas, the Ashkharhatsuyts, commonly attributed to Anania Shirakatsi, mentions Alinja by its Armenian name, Yernjak, describing it as the first canton of the Kingdom of Armenia's province of Syunik'. The ruins of the medieval Yernjak (or Ernjak) fortress, which dates from the 7th century, are located on a crag overlooking Alinja village. This fortress once controlled, and gave its name to, Yernjak province, which comprised the whole valley down to the Araks river. A separate Armenian tradition states that the province was named after Lady Yernjik, a member of the royal family of the Syunik' princes. The Armenian historian Stepanos Orbelian noted its formidable position, describing it as the "impossibly sturdy Yernjak."
The province belonged to the Arshakuni kings of Armenia until their kingdom was dissolved in 428 A.D. The Armenian king Smbat I Bagratuni captured the canton and the fortress from the Arabs, who had taken them in 698. However, the emir of Āzarbāijān, Yusuf Ibn Abi'l-Saj, put the fortress under siege for a year and captured it, awarding it to the Muslim emir of Goght'n. The long and arduous struggle between king Smbat and emir Yusuf ended at Yernjak, where the latter put the former to death in 914. However, by the end of the tenth century Yernjak was back in the hands of the princes of Syunik'. After the dissolution of the Bagratuni Kingdom of Armenia in 1045, in the following centuries the region passed into the hands of external powers. It was taken by the Seljuks in the eleventh century, and by the Mongols in the thirteenth century. The fortress is assumed to have been razed by the forces of Nadir Shah. The district became part of the Russian Empire following the conclusion of the 1826-1828 Russo-Persian war. In 1921 it became a part of the Azerbaijan SSR.
- (Armenian) Darbinyan, M. «Երնջակ» (Yernjak). Armenian Soviet Encyclopedia. vol. iii. Yerevan: Armenian Academy of Sciences, 1977, pp. 637-638.
- Adontz, Nicholas (1970). Armenia in the Period of Justinian: The Political Conditions Based on the Naxarar System. Trans. Nina G. Garsoïan. Lisbon: Calouste Gulbenkian Foundation. p. 120*. In the long recension of the Ashkharatsuyts, this section, in Classical Armenian, reads: "Աշխարհ Սիւնիք, ընդ մեջ կալով Երասխայ և Արձախայ, յելից Այրարտոյ. ունի գավառս երկոտասան. զԵրնջակ, զՃահուկ..."
- (Armenian) Aivazian, Argam (1990). Nakhijevan: Book of Monuments / Նախիջևան, Գիրք Հուշարձանաց. Yerevan: Anahit Publishing. p. 57.
- In Classical Armenian, "անհնարին ամուրն Երնջակ."
- (Armenian) Ter-Ghevondyan, Aram N. (1965). Արաբական Ամիրայությունները Բագրատունյաց Հայաստանում (The Arab Emirates in Bagratuni Armenia). Yerevan: Armenian Academy of Sciences. p. 130.
- (Armenian) Harutyunyan, Babken H. "Սյունիքը IX-XI դարերում" ("Syunik' During the Ninth to Eleventh Centuries"). History of the Armenian People. vol. iii. Yerevan: Armenian Academy of Sciences, 1976, p. 121.