Alinja (also known as "Alıncak"; Azerbaijani: Əlincə; Armenian: Երնջակ, Yernjak or Ernjak) 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.
Alinja is mentioned in historical records for the first time in the seventh century atlas, the Ashkharhatsuyts, commonly attributed to Anania Shirakatsi, under its original Armenian name, Yernjak. It is described as the first district of the Kingdom of Armenia's province of Syunik'. The ruins of the medieval Yernjak (or Ernjak) fortress, which dates to the seventh 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 "impossible to penetrable 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. Yernjak was invested by the forces of Tamerlane but the fortress managed to withstand the siege for thirteen years, until it was taken in 1401. The fortress was probably razed by the forces of Nadir Shah.
- (Armenian) Darbinyan, M. «Երնջակ» (Yernjak). Armenian Soviet Encyclopedia. Yerevan: Armenian Academy of Sciences, 1977, vol. 3, pp. 637-38.
- 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: "Աշխարհ Սիւնիք, ընդ մեջ կալով Երասխայ և Արձախայ, յելից Այրարտոյ. ունի գավառս երկոտասան. զԵրնջակ, զՃահուկ..."
- Aivazian, Argam (1990). Nakhijevan: Book of Monuments / Նախիջևան, Գիրք Հուշարձանաց (in Armenian). Yerevan: Anahit Publishing. p. 57.
- Ter-Ghevondyan, Aram. (1976), The Arab Emirates in Bagratid Armenia, trans. Nina G. Garsoïan. Lisbon: Calouste Gulbenkian Foundation, p. 70.
- (Armenian) Harutyunyan, Babken H. (1976), "Սյունիքը IX-XI դարերում" [Syunik' During the Ninth to Eleventh Centuries], in Հայ Ժողովրդի Պատմություն [History of the Armenian People], eds. Tsatur Aghayan et al. Yerevan: Armenian Academy of Sciences, vol. 3, p. 121.
- Bedrosian, Robert (1997). "Armenian during the Seljuk and Mongol Periods," in The Armenian People From Ancient to Modern Times, Volume I: The Dynastic Periods: From Antiquity to the Fourteenth Century, ed. Richard G. Hovannisian. New York: St. Martin's Press, pp. 267-68.