When Guru Hargobind Sahib bestowed Guruship on Guru Har Rai he advised him to keep two thousand & two hundred armed soldiers with him. He also asked him to remain fearless. Then he granted him a boon that whoever came to attack him would be killed on his way. Theae words of Guru Hargobind Sahib proved true. Aurangzeb invaded Guru Hari Rai thrice but failed.
Dara Shakoh had a great regard and love for Guru Har Rai. The Guru had saved his life by providing him the suitable medicine medicine. In the war of succession. Dara Shakoh was defeated by Aurangzeb and he fled towards Punjab. He reached Kiratpur, but there he was informed that the Guru had gone to Goindwal. Form Kiratpur, Dara Shakoh reached Goindwal. The Guru conoled and encouraged him. Dara Shakoh requested the Guru that he should stop the forces of Aurangzeb at the bank of the river Beas so he might reach Lahore safe and sound. The Guru ordered his soldies to keep watch at the bank of the river for a day. In this way the Guru helped Dara Shakoh. King Aurangzeb was a very crulel man. Whovever helped Dara Shakoh, King Aurangzeb got him killed. As the Guru had also helped Dara, so Aurangzeb wanted to kill the Guru. So he sent his generals thrice to annihilate Kiratpur.
Firstly he sent Zalam Khan with ten thousand armed forces invade Kiratpur. But while on his way he took the uncooked meat of an animal and died due to severe pain in his stomach. Aurangzeb again sent his another general Dhoode Khan of Kandhar to attack Kiratpur. When he reached Kartarpur his one enemy killed him while he was asleep. When soldiers saw their commander dead,they returned back.
Third time Aurangzeb entrusted this task to general Nahar Khan who was ruler of Saharanpur. Aurangzeb ordered him to annihilate Kiratpur completely and to arrest the Guru alive. But when the army of Nahar Khan reached Yamana Nagar, cholera spread in the army. The soldiers were dying like sheep and goats. Nahar Khan died with half of his army. When remaining army came to know that it was all due to the curse of the Guru, They were so horrified that they ran away. After that no general dared to attack Kiratpur.
Thought the Guru was granted a boon that enemy would not be able to do any harm to him, still the Guru did not want to see the cruel Aurangzeb. Guru Har Rai was a light of Nanak, so he was not afraid of any power but saints never like to meet such crul persons who had killed his brothers and relatives to bcome the king. He was not a pious man, but he was killing pious men to bring then then into the fold of Islam. It was his profession to kill the saints and mystics. He killed the great Sufi Saint’Sarmad’ in his Darbar. Guru Har Rai was also summoned to attend the darbar of Aurangzeb. But he sent his elder son Ram Rai. But Ram Rai in order to please Aurangzeb performed miracles and even changed one word of the hymns of Guru Nanak. This enraged Guru Har Rai and he excommunicated Ram Rai. He also decided to bestow the Guruship on his younger son, Sri Harkrishan.
When Guru Har Rai entrusted Guruship to Sri Harkrishnan he advised him not to see Aurangzeb. Guru Harkrishan acted on his advice and when Aurangzeb sent for him to delhi, he breathed his last, but did not see the face of Aurangzeb