The Ghilji (Pashto: غلجي), also known as Khilji (Pashto: خلجي), Ghilzai (Pashto: غلزی), and Gharzai (Pashto: غرزی, ghar literally means "mountain" and zai "born of"), are the largest Pashtun tribal confederacy.
The Ghilji at various times became rulers of present Afghanistan region and were the most dominant Pashtun confederacy from c. 1000 A.D. until 1747 A.D., when power shifted to the Durranis. The Ghilji tribes are today scattered all over Afghanistan and some parts of Pakistan, but most are concentrated in the region from Zabul to Kabul province, with Ghazni and Paktika provinces in the center of their region.
The Ghilji tribes are also settled in Balochistan and Khyber Pakhtunkhwa in Pakistan. Many of the migrating Kochi people of Afghanistan belong to the Ghilji confederacy.
From 1709 to 1738, the Ghilji ruled the Hotak Empire based first in Kandahar, Afghanistan and later, from 1722–1728, in Isfahan, Persia.
Etymologically the word Ghilji is derived from ghar-zai (غرزی), meaning "son of mountain".
The most plausible theory suggests that the Ghilji descended from the Khalaj people, probably of Turkic origin, who early settled in the Siah-band range of the Ghor mountains, and first rose into the notice in the time of Mahmud of Ghazni, whom they accompanied in his invasions of India.
The Ghilji may have also descended at least in part from the Ghurids:
"Ghalzaī tribal genealogies in general trace their early descent from the union of either Shah Ḥosayn, a Ghurid (q.v.) prince and, Bībī Mātō, a granddaughter of Qays ʿAbd al-Rašīd, the putative ancestor of all Pashtuns, or Mokarram Shah, a Pashtun prince from Ḡūr, and the daughter of a Persian notable..."
The German orientalist Bernard Dorn, in volume 2 of his book "The History of Afghans" which is mainly based on Tārīkh-e Khān Jahānī wa Makhzan-e Afghānī (تاریخ خان جهانی ومخزن افغانی) of Nimat Allah al-Harawi, supports the Ghilji descent from Bibi Mato, daughter of Shaykh Beṭ Nīkə (the folkloric leader or ancestor of all Bettani), in the following words:
"To Ghilzye, who belongs to the Matis, God Almighty granted three sons, Ibrahim, Toor(Toran) and Poor(Boran). Ibrahim had two sons Haijub and Shabak. Haijub had thirteen sons, Sulaimankhel, Alikhail, Omerkhail, Karikhail, Hameerkhail, Paroki, Varaki, Chani, Donyar and Tanokhel Tanoli. Sahbak had two sons, Bujikhail and Ismailkhail. Toor(Toran), Ghilzye's son, had three sons, Tarakai, Bakhtu, and Andar."
According to Minhaj al-Siraj Juzjani, a 13th-century historian, "there were over 15 great Khalji personalities who ruled from 1203 A.D. onwards over India and were spreading Khorasanian and Islamic culture all over northern India and the highlands of North Bengal.".
In the beginning of the 18th century, the Ghilji revolted against their Persian rulers,established themselves under Mir Wais as independent rulers at Kandahar and overrun Persia. When the Hotak tribe, under the leadership of Mirwais Hotak and Nasher Khan of the Ghaznavid revolted against the Safavids in 1709, the Ghilji came into conflicts with their western neighbors. Mir Wais, an influential Afghan tribal leader and founder of the Hotak dynasty, had visited the Persian court and studied their military weaknesses. The Afghan tribes rankled under the ruling Shia Safavids because of their continued attempts to convert the Pashtuns from Sunni to Shiaism Spawning Afghan nationalism, Mir Wais succeeded in expelling the Safavids from Kandahar. His eldest son, Mahmud, effected a successful invasion of Persia (now Iran) which culminated in the conquest of Isfahan and the deposition of the Safavid Shah Sultan Husayn. Mahmud was then crowned Shah and ruled for a brief period before being deposed by his own clansmen. His cousin and successor (Ashraf Hotak) reigned for nearly five years before being killed by Baloch tribes while fleeing towards Kandahar. Their rule ended after the Siege of Kandahar in 1738.
In Afghanistan the Ghilji are scattered all over the country but mainly settled around the regions between Zabul and Kabul provinces.The Afghan province of Paktika is considered to be a heartland of the Ghilji tribe. Ghilji sub-tribes in Paktika include the Kharoti, especially in the Sar Hawza and Urgon districts, the Andar and the largest single Ghilji sub-tribe, the Suleimankhel, who are the majority in northern and western areas of Paktika such as; Katawaz. After the great Ghilji rebellion in 1885–1886, led by Alam Khan Nasher, many members of the Ghilji tribe, such as; the Kharoti sub-tribe and particularly the Nasher clan were exiled from Loya Paktia (Paktia, Paktika and Khost) to Kunduz in the north by Amir Abdur Rahman Khan due to political reasons. They are predominantly a nomadic group unlike the Durranis who are usually found in permanent settlements.The Ghilji mostly work as herdsmen as well as construction workers and in other jobs that allow them to travel. Often possessing great mechanical aptitude, the Ghilji nonetheless have an extremely low literacy rate hovering below 10% in Afghanistan. The Ghilji regularly cross over between Afghanistan and Pakistan often being exempted from customs due to the acceptance of their nomadic traditions by officials from both countries. Population estimates vary, but they are most likely around 20% to 25% of the population of Afghanistan and probably number over 9 million in Afghanistan alone with 4 million or more found in neighboring Pakistan mostly in Quetta.
The Ghilji in Pakistan are usually recognized by its tribes and sub-tribes located in various parts of the country.In Quetta many members of Ghilji tribe such as Kharoti, Suleimankhel, Andar are mainly concentrated in Northern and City Central Areas. Whereas in Khyber Pakhtunkwa and Punjab Ghilji Sub-tribes like Niazi and Tanoli dwell both in plain and hilly areas. The Niazi are mostly settled in Bannu District Of Khyber Pakhtunkhwa and Mianwali district of the Punjab.Whereas, the Tanoli are mostly settled in Tanawal Region of Khyber Pakhtunkhwa.Akakhel
Stanikzai or Stanizai