Mirwais Khan Hotak (Pashto: مير ويس خان هوتک), also known as Shah Mirwais Ghilji (Pashto: شاه ميرويس غلجي) (lived 1673 – November 1715), was an influential tribal chief of the Ghilji Pashtuns from Kandahar, Afghanistan, who founded the Hotak dynasty that existed from 1709 to 1738. After revolting and killing the Safavid Persian governor over the region, Gurgin Khan in April 1709, he declared what is now southern Afghanistan independent. He is widely known as Mirwais Nikə (ميرويس نيکه) or Mirwais Baba (ميرويس بابا, "Mirwais the father") in the Pashto language.
In 1707, Kandahar was in a state of chaos, fought over by the Shi'a Persian Safavids and the Sunni Moghuls of India. Mirwais Khan, a Sunni tribal chief whose influence with his fellow-countrymen made him an object of suspicion, was held as a political prisoner by Gurgin Khan, the Persian governor in the region, who then sent him to the Safavid court at Isfahan. He was later freed and even allowed to meet with the Shah, Sultan Husayn, on a regular basis. Having ingratiated himself with the Persian court, Mirwais sought and obtained permission to perform the pilgrimage to Mecca in the Ottoman Empire (after which he was known as Hajji). At that time the once powerful Safavids were declining politically and militarily, riven by internal strife, royal intrigues, and endless wars against their arch rivals, the Ottomans. During his time in Persia, Mirwais tried to learn all the military weaknesses of the Safavids.
While in Mecca, he sought a fatwa from the leading religious authorities against the foreign rulers who were persecuting his people in his homeland. The Pashtun tribes rankled under the ruling Safavids because of their continued attempts to forcefully convert them from Sunni to Shia Islam. The fatwa was granted and he carried it with him to Isfahan and subsequently to Kandahar, with permission to return and strong recommendations to Gurgin Khan.
He began organizing his countrymen for a major uprising, and in April 1709, when a large part of the Persian garrison was on an expedition outside the city, he and his followers fell on the remainder and killed the majority of them, including Gurgin Khan. With the death of Gurgin Khan, the Hotaki soldiers took control of the city and then the province. Mirwais entered Kandahar and made an important speech to its inhabitants:
"If there are any amongst you, who have not the courage to enjoy this precious gift of liberty now dropped down to you from Heaven, let him declare himself; no harm shall be done to him: he shall be permitted to go in search of some new tyrant beyond the frontier of this happy state."
Mirwais and his forces then defeated a large Persian army that was sent to regain control over the area.
Several half-hearted attempts to subdue the rebellious city having failed, the Persian Government despatched Khusraw Khan, nephew of the late Gurgin Khan, with an army of 30,000 men to effect its subjugation, but in spite of an initial success, which led the Afghans to offer to surrender on terms, his uncompromising attitude impelled them to make a fresh desperate effort, resulting in the complete defeat of the Persian army (of whom only some 700 escaped) and the death of their general. Two years later, in A.D. 1713, another Persian army commanded by Rustam Khan was also defeated by the rebels, who thus secured possession of the whole province of Qandahar.
Mirwais Khan became the governor of the Greater Kandahar region, which covered most of present-day Afghanistan and part of pashtun areas of Balochistan, Pakistan. To the northwest were the Abdali Pashtuns and to the east lay the Moghul Empire. Refusing the title of king, Mirwais was referred to as "Prince of Qandahar and General of the national troops" by his Afghan countrymen.
Mirwais remained in power until his death in November 1715 and was succeeded by his brother Abdul Aziz, who was later killed by Mirwais' son Mahmud, allegedly for planning to give Kandahar's sovereignty back to Persia. In 1717, Mahmud took advantage of the political weakness of the Persian Shah (Sultan Husayn) and briefly conquered large parts Persia.
Mirwais is buried in his mausoleum in the Kokaran section of Kandahar, which is in the western end of the city. He is regarded as one of Afghanistan's greatest national heroes and admired by many Afghans, especially the Pashtuns. Steven Otfinoski referred to him as Afghanistan's George Washington in his 2004 book Afghanistan.
There is a neighborhood called Mirwais Mina as well as a hospital called Mirwais Hospital, a high school and a business center named after him in Kandahar. There are also schools and a number of institutions or places across Afghanistan built to honor him. A few direct descendants of Mirwais are living today among the Hotak tribe.