The Ghilji (Pashto: غلجي Ghəljī), Persian: غلزایی), also called Khaljī (خلجي), Khiljī, Ghilzai, or Gharzai (غرزی; ghar 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.Ashraf Ghani Ahmadzai, the current President of Afghanistan, also belongs to the Ghilji tribe.
From 1709 to 1738, the Ghilji ruled the Hotak Empire based first in Kandahar, Afghanistan and later, from 1722–1728, in Isfahan, Persia. The founder of the Hotak Empire was Mirwais Hotak. Another famous Ghilji from the 18th century was Azad Khan Afghan, who rose to power from 1752 to 1757 in western Iran.