Babar was the first of the Mughals to invade India in 1521, and seize power at Delhi by defeating the army of the Lodhi Sultan Ibrahim at Panipat in 1526. towards December 1719, Mohammed Shah Rangila was placed on the throne inspite of the protestations of his widowed mother. Power slowly passed from the hands of the Sayad brothers into the hands of Mohammed Amin Khan. He died in 1721 and was replaced hy his son Qamar-ud-din Khan. Mohammed Shah remained an Emperor in name only till his death in 1748. During all these years Afghanistan (then known as Kabul) had heen a part of the Mughal Kingdom, and at the time of Mohammed Shah it was under Governor Nasir Khan. This man's control over his province was as weak as that of the Delhi Emperor. There was hardly any collection of state revenues. The soldiers had not been paid for several years, which in fact was happening in Delhi too.
Such conditions of unrest and frustration provided an energetic outsider like Nadir Shah a golden opportunity to seize power. A son of a poor shepherd in Khurasan, a province of Iran, Nadir had joined a robber band when he was still a boy. He grew up to be its leader at about the time in 1717, when the Afghans occupied Khurasan and later the capital of Iran. Nadir's patriotic zeal was roused and he rallied a strong band of horsemen who helped him regain Khurasan. By 1725, he had hecome a national hero, who drove the Afghans out of Iran, and who hecame a sort of regent with a boy of the royal family as King of Iran In 1736, when the boy King died, Nadir assumed the title of Emperor of Iran.
The Afghans had invaded Iran several times, and to avenge these raids, Nadir Shah advanced upon Ghazni and then Kabul, both of which were occupied in May, 1738. The Governor Nasir Khan was then in Peshawar. As Nadir Shah rode out towards the Khyher Pass in November 1738, Nasir tried to block his passage with a force of 20,000 ill trained Afghans, who were just no match for the fierce Khurasani horsemen. By December 1738, Nadir Shah had crossed the river Indus, and the lush plains of the Punjah stretched before him, literally beckoning him on. Zakaria Khan had made frantic requests for aid from Delhi, but without success. When he himself came out to oppose the invaders at the hanks of the river Ravi, his army was just brushed aside (January, 1739).
Nadir Shah was an able general and a wise administrator but insane criminal. His band of soldiers would aptly be called freebooters, rapists and looters. Atrocities were committed on Punjabi Muslims and Hindus alike. Then, He accepted a gift of two million rupees and retained Zakaria Khan as his governor at Lahore. He took as hostages a son of Zakaria and a son of the minister Lakhpat Rai, and thus secure against revolt, he proceeded towards Delhi. As his whole army was on horseback, his advance was rapid. Leaving Lahore on the 26th January, he reached Sirhind on the 1st February, Ambala on the 7th, and Karnal on the 12th Fehruary. The Delhi army had been alerted in Novemher on the fall of Kabul. The generals dragged their feet in moving out of Delhi. Every fresh report of Nadir s advance struck terror into them. They took two months to move their large army and their heavy guns up to Karnal, a distance of 75 miles. Here, they decided to give battle. They heavily outnumbered the attackers, but had no discipline and hardly any heart for a fight. On the 13th February, 1739, within three hours they had lost, over 20,000 killed or wounded, and the rest just scattered in all directions.
Nadir Shah entered Delhi as a victor on 9th March, 1739. He demanded 2.5 million Rupees as retribution, but the Rangila Emperor had nothing in his government treasury. He threw open his personal safe of jewels, and Nadir availed himself of all the diamonds and rubies of the Peacock Throne, and also the famous Koh-i-noor.
He left Delhi at the beginning of May 1739, taking with him a few thousand Indian girls (both Hindu and Muslim), a large number of boys as slaves and thousands of elephants, horses and camels loaded with the booty his men had collected. The hollow shell that made up the Mughal empire had been smashed open by Nadir Shah with one sweep, and the Sikhs quickly moved in to collect the broken pieces.
During his stay at Delhi, the Sikhs had come out of their jungle retreats and had no difficulty in looting all the Mughal posts at countryside from the river Chenab to the areas around Karnal. Zakaria Khan's police forces were too demoralised to offer resistance. So Nadir's arrival was most opportune for the Sikhs in the replenishment of their depleted stores. Again when people learnt about his departure from Delhi, the rich landlords and noblemen promptly evacuated the cities and headed for the hills as they could not trust Mughals for their security anymore. Mohmmad Shah Rangila was a bad administrator, all his croonies had looted the rich landlors and elite after Nadir Shah left to fill up the coffers of Mughal kingdom.
Meahwhile, The Khalsa bands got together and passed a resolution: "Nadir Shah must deliver a part of the booty he was carrying away from Delhi." Nadir, on the other hand, felt that his reputation was a sufficient deterrent to anyone attacking him on the way. He had chosen the route along the foothills of the northern mountains to escape the heat of the plains. His baggage train being heavy-laden, lagged well behind his main force, and it was quite a shock for him to hear on reaching Akhnoor by the river Chenab, that all his slaves had been freed by Sikh bands, who had also seized a large share of his gold. Sardar Jassa Singh Ahluwalia who had just turned 21, showed a glimpse of his greatness as a leader by planning those raids, and by escorting the freed maidens to responsible homes from where they could return to their families.
Zakaria Khan had accompanied Nadir Shah to Akhnoor, and Nadir asked Zakaria Khan who those Sikhs were. On being told that they were all bands of poor sadhus, without clothing or riches, he asked;
"Then why don't you burn their houses down to punish them ?" To that Zakaria replied, "Their only homes are the saddles of their horses. They can last long periods without food and rest. They are known to sleep on horseback. We have put prizes on their heads, but their numbers keep increasing. They are never despondent, but are always singing the songs of their Pirs."
With a sigh, Nadir admitted that in that case the Sikhs would one day rule the land. Then he obtained a promise of a tribute of 2 million Rupees annually from Lahore, and confirmed the appointment of Zakaria Khan at Lahore and of his son Shah Nawaz Khan at Multan (where Abdus Samad Khan had just died).
With the departure of Nadir Shah, Zakaria Khan took stock of his household and saw it all in ruins. He decided to take full revenge on the Sikhs for all his misfortunes.