The Emperor called on his troops to account for their cowardice. They pleaded that the Sikhs had taken an unfair advantage of their position in the battle field. At one point the Emperor asked what sort of person the Guru was and what force he possessed. A Mohammadan soldier gave highly colored accounts of the Guru's beauty, sanctity and prowess. He described him as a young handsome man, a living saint, the father of his people and in war equal to one hundred twenty-five thousand men. The Emperor was much displeased on hearing this elaborate praise of the Guru and ordered that he should be brought to his presence. In the meantime Raja Ajmer Chand made a strong representation to the Emperor for assistance to bring the Guru to submission. Accordingly the viceroys of Sirhind, Lahore and Kashmir were ordered to proceed against the Guru.
Some faithful Sikhs informed the Guru of war preparations as a result of Raja Ajmer Chand's representationto the Emperor. The Guru made arrangements accordingly and sent for his followers. The Sikhs of Majha, Malwa and Doaba and other places thronged to Anandpur. They were delighted at the prospect of battle, and congratulated themselves on their good fortune in being allowed to die for their Guru and their faith. The Guru affirmed that the death in the battle-field in the name of religion was equal to the fruits of many years' devotion, and ensured honor and glory in the next world.
The noteworthy point in this whole episode is that the Guru having won battle after battle, never captured an inch of territory, never nurtured enmity, and never attacked anybody as an aggressor. By the creation of the Khalsa he established equality and brotherhood of mankind. The down-trodden segments of the society which were ever ridiculed by the so called high caste Brahmans and Khatris, had now become undaunted saint-soldiers after being baptized by the Guru and joining the brotherhood of the Khalsa. The Brahmans and the hill chiefs considered all this a threat to their very existence. They were, therefore, waging a constant war against the Guru and his Sikhs.
The hill chiefs who arrayed themselves against the Guru were Raja Ajmer Chand of Kahlur, Rajas of Kangra, Kullu, Kionthal, Mandi, Jammu, Nurpur, Chamba, Guler, Garhwal, Bijharwal, Darauli and Dadhwal. They were joined by the Gujars and the Ranghars of the area, and all of them formed a formidable force. The imperial army of the viceroys' of Sirhind, Lahore and Kashmir came in large number. The chronicler judiciously remarks that the Khalsa must be congratulated because, though few in number, having the blessings of their Guru they had confidence in themselves to fight for their religion, and delighted in anticipation of the approaching conflict. It is recorded that there were ten thousand Sikhs at Anandpur while the opposing army came as strong as fifteen to twenty times in number than the Sikhs
The allied forces fell on Anandpur like locust. On seeing this the Guru ordered his artillery men to discharge their cannon into the hostile army at the thickest spot. The enemy made a charge to seize the artillery, but were quickly restrained by the fatal accuracy with which the Sikhs served their guns. They were supported by the infantry. The city of Anandpur was on a little higher elevation and the allied forces were in the open and had no protection, and consequently fell in heaps. A fierce battle was fought for a few days. The Mohammadan gunners were promised large reward if they killed the Guru but they were unsuccessful in their mission because their gun fire was either high or too low and could not hit the target. The allied army finding their guns useless tried hand to hand fight. On seeing this the Guru began to discharge his arrows with marvelous effect. The fearful carnage continued, horses fell on horses, men on men. The allied forces rallied a strong effort to conquer, but was so vigorously and successfully repulsed that they were obliged to uspend hostilities at the end of each day of warfare. The Mohammadans and the hill chiefs had different opinions as to the cause of the success of the Sikhs. Some thought that the Guru had supreme miraculous power and the supernatural forces fought on his side. Others maintained that the Guru's success was owing to the fact that his men were protected behind their ramparts. While this discussion was going on, the Mohammadan viceroys decided to storm the fortress where the Guru was stationed. On seeing this the Sikhs put their two guns called Baghan (tigress) and Bijai-ghosh (sound of victory) in position. The aims were taken at the enemy. The tents were blown away and great havoc was caused. On seeing this the Mohammadan viceroys retreated and the hill armies fled. That evening the Guru offered thanksgiving, and beat the drum of victory.
Having failed through dire ct assault, the allied army planned a siege of the city of Anandpur in such a waythat all entrances and exits for both goods and persons were completely closed. This siege took eight months long, and is often known as the War of Sri Anandpur Sahib, which the Mughal Imperial Army, allied with each of the Hill Raja clans except a few launched an all out war against Guru Ji's Khalsa. The siege numbers were one million soldiers of the Mughal Imperial Army and 10,000 sikhs under the control of the founder of Khalsa. They completely besieged the city, and the Guru's supplies were failing. Food position became extremely serious and the Sikhs were driven to undertake some dangerous expeditions. They went out at night to snatch provisions from the besiegers. After some time the allies collected their stores at one place and guarded them day and night. When the enemy learnt about the distressful situation of the Sikhs, they planned a different strategy to induce the Guru to leave Anandpur. Raja Ajmer Chand sent his envoy to him saying that if he left Anandpur, their armies would withdraw and he could afterwards return whenever he pleased. The Guru did not pay any heed to this proposal. The offer was repeated several times, but the Guru did not accept it. Having suffered extreme hardships, the Sikhs besought the Guru to evacuate the fort, but the Guru counselled them patience for some time more. The Sikhs who heard enemy's proposal, went to the Guru's mother to use her influence on him. She pleaded with him but in vain. The Guru told her that the enemy's proposal was hypocritical since they planned to draw out the Sikhs from within the shelter of the city and attack them. Some of the Masands and the Sikhs who were influenced by the hill chiefs, insisted that the proposal of the enemy be accepted and the city be abandoned. Some Sikhs became impatient and
Dish eartened. The Guru asked them to declare their allegiance. Forty of them signed a disclaimer saying that the was not their Guru and they were not his Sikhs. After they signed the disclaimer, they were allowed by the Guru to go away. (These 40 sikhs came back at the Battle of Mukstar, and in Sikhi are known as the "Chali Mukte" or 40 immortals. Under the command of a legendary sikh general, they fought 10,000 Mughal Imperial Soldiers, and gave such devasting damage to the enemy, they had no option but to retreat. Guru Ji, in the end blessed them, as they had come back to fight for there protector) Guru Ji then brought out a scheme to expose the hypocrisy of the enemy.
The Guru sent for Raja Ajmer Chand's envoy and told him that he would evacuate Anandpur if the allied armies would first allow the removal of his treasure and property. The Hindus swore on the Salgram (their idol) and the Mohammadans on the holy Quran, that they would not deceive or molest his servants departing with his property. The Guru then immediately ordered a number of cartloads of useless articles. To the bullocks' horns were attached torches and at the dead of night, the caravan of bullocks with their loads, started along with some Sikhs accompanying them. When the caravan reached the enemy lines they forgot all their pledges and fell upon the small company of the Sikhs to loot the treasure. Their disappointment was great when they found out that the treasure was made up of rubbish articles. In this way the Guru exposed the treachery of the enemy and told his Sikhs that everything they had endured had been by the Will of God, and he quoted Guru Nanak- "Happiness is a disease, the remedy for which is unhappiness".
At last came an autographed letter from the Emperor to the Guru- "I have sworn on the Quran not to harm. You. If I do, may I not find a place in God's court hereafter! Cease warfare and come to me. If you do notdesire to come hither, then go whithersoever you please." The Emperor's envoy added that the Emperor promised that he would not harm the Guru. The hill Rajas also swore by the cow and called their idols to witness, that they would allow safe passage to the Guru. The Guru told the enemy," You are all liars, and therefore all your empire and your glory shall depart. You all took oaths before and then perjured yourselves."
The Sikhs went again to the Guru's mother to complain of his refusal to listen to reason. He, however, felt that their pleading was not reasonable but it was not appropriate to accept the terms of the enemy and leave the fort. The Sikhs stricken with hunger, supported the envoy's representation. The Guru comforted them," My brethren, waver not, I only desire your welfare. You know not that these people are deceivers and design to do us harm. If you hold a little longer, you shall have food to your heart's content." When the Sikhs refused to wait any longer, he asked them to wait only a few days more when the great God would send them relief. The Sikhs, however, refused to wait even for a day. The Guru repeated his request saying that the enemy would then retire and they would all be happy. He also warned the Sikhs," O dear Khalsa, you are rushing to your destruction, while I am endeavoring to save you."
The Sikhs were so much hunger stricken that they refused to stay even for a day. The Guru's mother was also in favor of evacuating the fort. The allied armies sent a Saiyid (a Mohammadan priest) and a Brahman, both of whom were to swear, on behalf of the allied armies, solemn oaths of safe conduct for the Guru should he evacuate Anandpur. On seeing this the Sikhs began to waver in their allegiance to the Guru, and in the end only forty Sikhs decided to remain with him and share his fortunes. He told them that they too might desert him. They refused and said that they would either remain within the fort or force their way out as the Guru directed. He knew that the seed of his religion would flourish. He then finally decided to leave Anandpur and gave orders to his men that they all were to march at night. Sri Anandpur Sahib was finally evacuated on 6-7 Poh, Sambat 1762 (20-21 December, 1705).
Bhai Daya Singh and Ude Singh walked in front of the Guru, Mohkam Singh and Sahib Singh on his right, the second batch of baptized Sikhs on his left. His sons the legendary hereos of Chamkaur, Shaheed Baba Ajit Singh Ji and Shaheed Baba Jujhar Singh Ji followed with bows and arrows. Then came Bhai Himmat Singh carrying ammunition and matchlocks. Gulab Rai, Sham Singh and other Sikhs and relations accompanied him. The rest of the followers brought up the rear, about five hundred in all. The moment the enemy got the news of Guru's departure, they again forgot all about their pledges and set out in hot pursuit immediately. Skirmishes started from Kiratpur onwards. Realizing the impending danger the Guru charged Ude Singh with the responsibility to check the advance of the enemy. Bhai Ude Singh fought a bloody battle at Shahi Tibbi. The enemy surrounded and killed the dauntless and the bravest of the Guru's brave warriors, Ude Singh. When the battle of Shahi Tibbi was in progress, the Guru had reached the bank of Sarsa river. At that time a news came that a contingent of enemy troops was fast approaching. Bhai Jiwan Singh, a Rangretta Sikh, was given a band of one hundred warriors to encounter the pursuers. With the rest of his people the Guru plunged into the flooded waters of the Sarsa river. The flood was so strong that many were drowned and many were scattered in different directions including the Guru's mother with two younger sons, Shaheed Baba Zorawar Singh Ji and Shaheed Baba Fateh Singh Ji. Besides, there was a heavy loss of valuable literature and property. The Guru accompanying his two eldest sons and some veteran Sikhs reached the village Ghanaula on the other side of Sarsa river. Apprehending that the route ahead might be beset with danger, the Guru gave Bhai Bachitar Singh a band of one hundred Sikhs and instructed him to march by the direct route to Rupar, whereas he with some veteran Sikhs preferred to take a longer route and reached Kotla Nihang near Rupar to stay with Pathan Nihang Khan who was an old and sincere devotee of the Sikh Gurus. Bhai Bachitar Singh and his men had to fight their way through a cordon of the Ranghars of Malikpur, a village near Rupar, and the Pathans of Rupar. During the fierce fighting that took place on this occasion, majority of the Sikhs fell dead and Bachitar Singh was mortally wounded.
The Guru did not stay long at Kotla Nihang. It seems that he was to proceed to Machhiwara and Rai Kot. Accompanied by his two eldest sons and forty Sikhs, the Guru halted at Bur Majra after Kotla Nihang. A news was received that a large body of Sirhind troops was chasing them. Immediately the Guru decided to face the enemy from within the Garhi of Chamkaur and he hurried towards it. He was well aware of the importance of this Garhi (mud fortress) as he had, on a previous occasion, fought a battle at this place.