The Durrani Empire is often considered the origin of the state of Afghanistan and Ahmad Shah Durrani is credited with establishing the modern nation state of Afghanistan. Even before the death of Nadir Shah of Persia, tribes in the Hindu Kush had been growing stronger and were beginning to take advantage of the waning power of their distant rulers.
Nadir Shah's rule ended in June 1747, when he was assassinated. The assassination was likely enough planned by his nephew Ali Qoli, though there is little factual evidence to support this theory. Nonetheless, when the chiefs of the Afghans met later the same year near Kandahar at a Loya jirga (council) to choose a new ruler for the Abdali confederation, Ahmad Shah Abdali was chosen. Despite being younger than other claimants, Ahmad had several overriding factors in his favor:
One of Ahmad Shah's first acts as chief was to adopt the title "Durr-i-Durrani" ("pearl of pearls" or "pearl of the age"). The name may have been suggested, as some claim, from a dream dreamt by Ahmad Shah, or as others claim, from the pearl earrings worn by the royal guard of Nadir Shah. The Abdali Pashtuns were known thereafter as the Durrani, and the name of the Abdali confederation was changed to Durrani.
The Mughal power in northern India had been declining since the reign of Aurangzeb, who died in 1707; the Marathas, who already controlled much of western and central India from their capital at Pune, were straining to expand their area of control. After Ahmad Shah sacked the Mughal capital and withdrew with the booty he coveted, the Marathas filled the power void.The Marathas defeated the Mugals in the north, the Sikhs emerged as a potent force in Punjab. Upon his return to Kandahar in 1757, Ahmad was forced to return to India and face the formidable attacks of the Maratha Confederacy, which succeeded in ousting Timur Shah and his court from India.
Ahmad Shah declared a jihad (or Islamic holy war) against the Marathas, and warriors from various Pashtun tribes, as well as other tribes such as the Baloch, Tajiks, and Muslims in India, answered his call. Early skirmishes were followed by victory for the Afghans, and by 1759 Ahmad and his army had reached Lahore and were poised to confront the Marathas. By 1760, the Maratha groups had coalesced into a great army that probably outnumbered Ahmad Shah's forces. Once again, Panipat was the scene of a confrontation between two warring contenders for control of northern India. The Third Battle of Panipat (January 1761), fought between largely Muslim and largely Hindu armies who numbered as many as 100,000 troops each was waged along a twelve-kilometer front. Despite decisively defeating the Marathas, what might have been Ahmad Shah's peaceful control of his domains was disrupted by other challenges.
The victory at Panipat was the high point of Ahmad Shah's -- and Afghan -- power. His Durrani empire was one of the largest Islamic empires in the world at that time. However, even prior to his death, the empire began to unravel. As early as by the end of 1761, the Sikhs had gained power and taken control of much of the Punjab. In 1762, Ahmad Shah crossed the passes from Afghanistan for the sixth time to subdue the Sikhs. He assaulted Lahore and, after taking their holy city of Amritsar, massacred thousands of Sikh inhabitants, destroying their revered Golden Temple. Within two years, the Sikhs rebelled again. Ahmad Shah tried several more times to subjugate the Sikhs permanently, but failed. By the time of his death, he had lost all but nominal control of the Punjab to the Sikhs, who remained in charge of the area until defeated by the British in the First Anglo-Sikh War in 1846.
Ahmad Shah also faced other rebellions in the north, and eventually he and the Uzbek Emir of Bukhara agreed that the Amu Darya would mark the division of their lands. In 1772, Ahmad Shah retired to his home in the mountains east of Kandahar, where he died. He had succeeded to a remarkable degree in balancing tribal alliances and hostilities, and in directing tribal energies away from rebellion. He earned recognition as Ahmad Shah Baba, or "Father" of Afghanistan from the Pashtuns.
Ahmad Shah was succeeded by his son, Timur Shah, who had been deputed to administer his fathers conquests in northern India, but had been driven out by the Marathas. Upon Ahmad Shah's death, the Durrani chieftains only reluctantly accepted Timur's accession. Most of his reign was spent fighting a civil war and resisting rebellion; Timur was even forced to move his capital from Kandahar to Kabul due to insurgency. Timur Shah proved an ineffectual ruler, during whose reign the Durrani empire began to crumble. He is notable for having had 24 sons, several of whom became rulers of the Durrani territories. Timur died in 1793, and was then succeeded by his fifth son Zaman Shah
After the death of Timur Shah, three of his sons, the governors of Kandahar, Herat and Kabul, contended for the succession. Zaman Shah, governor of Kabul, held the field by virtue of being in control of the capital, and became shah at the age of twenty-three. Many of his half-brothers were imprisoned on their arrival in the capital for the purpose, ironically, of electing a new shah. The quarrels among Timur's descendants that threw Afghanistan into turmoil also provided the pretext for the intervention of outside forces.
The efforts of the Sadozai heirs of Timur to impose a true monarchy on the truculent Pashtun tribes, and their efforts to rule absolutely and without the advice of the other major Pashtun tribal leaders, were ultimately unsuccessful. The Sikhs became particularly troublesome, and after several unsuccessful efforts to subdue them, Zaman Shah made the mistake of appointing a forceful young Sikh chief, Ranjit Singh, as his governor in the Punjab. This "one-eyed" warrior would later become an implacable enemy of Pashtun rulers in Afghanistan.
Zaman's downfall was triggered by his attempts to consolidate power. Although it had been through the support of the Barakzai chief, Painda Khan Barakzai, that he had come to the throne, Zaman soon began to remove prominent Barakzai leaders from positions of power and replace them with men of his own lineage, the Sadozai. This upset the delicate balance of Durrani tribal politics that Ahmad Shah had established and may have prompted Painda Khan and other Durrani chiefs to plot against the shah. Painda Khan and the chiefs of the Nurzai and the Alizai Durrani clans were executed, as was the chief of the Qizilbash clan. Painda Khan's son fled to Iran and pledged the substantial support of his Barakzai followers to a rival claimant to the throne, Zaman's older brother, Mahmud Shah. The clans of the chiefs Zaman had executed joined forces with the rebels, and they took Kandahar without bloodshed.
Zeman Shah's overthrow in 1801 was not the end of civil strife in Afghanistan, but the beginning of even greater violence. Mahmud Shah's first reign lasted for only two years before he was replaced by Shuja Shah.
Mahmud's second reign lasted nine years. Mahmud alienated the Barakzai, especially Fateh Khan, the son of Painda Khan, who was eventually seized and blinded. Revenge would later be sought and obtained by Fateh Khan's youngest brother, Dost Mahommed Khan.
Ayub Shah was another son of Timur Shah, who deposed Sultan Ali Shah. He was himself deposed, and presumably killed, in 1823.