SHĀH ZAMĀN, son of Taimūr Shāh and grandson of Ahmad Shāh Durrānī, became the ruler of Afghanistan in May 1793 at the age of 23. As soon as Shāh Zamān came to the throne, he proclaimed his intention of re-establishing the Afghān sway in India. His first attempt to conquer India brought him as far as Hasan Abdāl; he had to return to Afghanistan to put down a revolt by his brother, Mahmūd. Two years later he was back in the Punjab again and, in addition to retaking Hasan Abdāl, he captured Rohtas from the Sukkarchakkīās, Raṇjīt Siṅgh thus being the first Sikh chieftain to suffer aggression at his hands. Once again Shāh Zamān had to return home, this time to prevent an invasion of his own country from the west. Raṇjīt Siṅgh did not have much difficulty in recovering Rohtās, but the Punjab had not yet seen the last of Zamān and his armies.
In the autumn of 1796 Shāh Zamān crossed the Indus for the third time with the intention of proceeding to Delhi. He had a well-equipped army of over thirty thousand men, and was assured of help from many quarters. As the news of the invasion spread, Sikh chiefs evacuated their families to the hills and forgathered in Amritsar. The two Sikh chiefs whose territories lay on the Afghāns' route to Lahore were Sāhib Siṅgh Bhaṅgī and Raṇjīt Siṅgh. Sāhib Siṅgh made a feeble attempt to halt the invaders. Raṇjīt Siṅgh also left his district and repaired post-haste to Amritsar. The majority of the sardārs who met in Amritsar felt that the best they could do was to retreat to the hills, and close in on the Afghāns when they were returning home with the booty. Raṇjīt Siṅgh exhorted them to stay in the plains to defend the people from whom they had been receiving a protection tax for many years. Many chiefs agreed to support him and he, taking command of the Sikh forces, cleared the Lahore countryside of the Afghāns and threw a cordon round the city. Every night he organized raids on different suburbs, keeping the invaders on the defensive.
In January 1797, Shāh Zamān received intelligence that his brother, Mahmūd, was again up in arms against him. He left his ablest officer, Ahmad Khān Shahāñchībāshī, with twelve-thousand Afghān soldiers in the Punjab and took the road back to Kābul. The Sikhs followed closely at his heels, harassing him all the way up to the Jehlum. Ahmad Khān, who attempted to attack Sikhs from the rear, was trounced at Rām Nagar. Raṇjīt Siṅgh decimated his columns fleeing towards Gujrāt.
On 27 November 1798, Shāh Zamān again entered Lahore. An Afghān detachment was sent towards Amritsar. Raṇjīt Siṅgh accompanied by other Sikh sardārs met it about 10 km outside the city and, after a fierce three hour encounter compelled the Afghāns to retreat. The Afghāns were pursued to the walls of Lahore.
Shāh Zamān was compelled to return to Afghanistan where his brother, Mahmūd, was again stirring up trouble. As soon as the news of Shāh Zamān's departure for Afghanistan reached the Sikhs at Amritsar, they broke camp and hurried back to reclaim their estates. Raṇjīt Siṅgh quickly reoccupied Gujrāṅwālā and went in pursuit of the Afghāns, keeping up a running fight with them right up to Aṭṭock. Shāh Zamān, still ambitious of establishing an empire in Hindustān, made overtures to Raṇjīt Siṅgh by sending him presents of horses and expensive dresses. Raṇjīt Siṅgh responded by restoring to him cannon the Shāh had lost in the Jehlum river in his hurry to escape.
Shāh Zamān, who made four attempts to conquer India, was overthrown by the Bārakzaīs who installed Mahmūd in his place. Mahmūd put out Zamān's eyes and turned him out of Kābul. The blind and dethroned Shāh Zamān took asylum at Rāwalpiṇḍī where he was met by Raṇjīt Siṅgh who invited him to come and stay in Lahore. Raṇjīt Siṅgh settled upon him a monthly allowance of 1,500 rupees and on his (Shāh Zamān's) arrival in Lahore accorded him a welcome befitting his rank.
Shāh Zamān died many years later a quiet and neglected pensioner of the British government at Ludhiāṇā.
Sardār Siṅgh Bhāṭīā