Sri Guru Hargobind Sahib Ji, before his departure for heavenly abode, nominated his grand son, Har Rai Ji at the tender age of 14, as his successor (Seventh Nanak), on 3rd March, 1644. Sri Guru Har Rai Ji was the son of Baba Gurditta Ji and Mata Nihal Kaur Ji(also known as Mata Ananti Ji). Sri Guru Har Rai Ji married to Mata Kishan Kaur Ji(Sulakhni Ji) daughter of Sri Daya Ram Ji of Anoopshahr (Bulandshahr) in Uttar Pradesh on Har Sudi 3, Samvat 1697. Guru Har Rai Sahib had two sons: Sri Ram Rai Ji and Sri Har Krishan Sahib Ji(Guru). Sri Guru Har Rai Ji was a man of peace but he never disbanded or discharged the armed Sikh Warriors(Saint Soldiers), who earlier were maintained by his grandfather (Sri Guru Hargobind Sahib Ji). He otherwise further boosted the military spirit of the Sikhs. But he never himself indulged in any direct political and armed controversy with the contemporary Mughal Empire. Once on the request of Dara Shikoh (the eldest son of emperor Shahjahan). Guru Sahib helped him to escape safely from the bloody hands of Aurangzeb's armed forces during the war of succession.
Once Guru Sahib was coming back from the tour of Malwa and Doaba regions, Mohamad Yarbeg Khan, (son of Mukhlis Khan, who was killed by Sri Guru Hargobind Sahib Ji in a battle) attacked the kafla of Guru Sahib with the force of one thousand armed men. The unwarranted attack was repulsed by a few hundred Saint Soldiers of Guru Sahib with great courage and bravery. The enemy suffered a heavy loss of life and fled the scene. This self-defense measure, (a befitting reply to the unwarranted armed attack of the privileged muslims), was an example for those who professed the theory of so called nonviolence or “Ahimsa Parmo Dharma”. Guru Sahib often awarded various Sikh warriors with gallantry awards.
Guru Sahib also established an Aurvedic herbal medicine hospital and a research centre at Kiratpur Sahib. There, he maintained a zoo also. Once Dara Shikoh, the eldest son of Shah Jahan fell seriously ill by some unknown disease. The best physicians available in the country and abroad were consulted, but there was no improvement. At last the emperor made a humble request to Guru Sahib for the treatment of his son. Guru Sahib accepting the request, handed over some rare and suitable medicines to the messenger of the emperor. The life of Dara Shikoh was saved from the cruel jaws of death. The emperor, whole heartily thanked and wanted to grant some “Jagir”, but Guru Sahib never accepted.
Sri Guru Har Rai Ji also visited Lahore, Sialkot, Pathankot, Samba, Ramgarh and many places of Jammu and Kashmir region. He established 360 Sikh missionary seats (ManJis). He also tried to improve the old corrupt Masand system and appointed pious and committed personalities like Suthre Shah, Sahiba, Sangtia, Mian Sahib, Bhagat Bhagwan, Bhagat Mal and Jeet Mal Bhagat (also known as Bairagi), as the heads of ManJis.
Sri Guru Har Rai Ji faced some serious difficulties during the period of his guruship. The corrupt masands, Dhir Mals and Minas always tried to preclude the advancement of Sikh religion. After the death of Shah Jahan, the attitude of the state headed by Aurangzeb towards the non-muslims, turned hostile.
The emperor Aurangzeb made an excuse for the help rendered to prince Dara Shikoh by Guru Sahib during the war of succession and framed false charges against Guru Sahib and was summoned to Delhi. Ram Rai Ji appeared on behalf of Guru Sahib in the court. He tried to clarify some misunderstandings regarding Guru Ghar and Sikh faith, created by Dhirmals and Minas. Yet another trap, which he could not escape, was to clarify the meaning of the verse “The Ashes of the Mohammedan fall into the potter’s clot, It is molded into pots and bricks, and they cry out as they burn”. Ram Rai, in order to please the emperor and gain more sympathy replied that the text had been needlessly corrupted by some ignorant person and inserted the word Musleman instead of word Beiman (dishonest). (The actual meaning of the verse is that the human soul is not bound to the physical structure or the body of a person. The physical material of the bodies of both Hindus and Muselmans face the same fate and it is a universal truth. The soul leaves the body immediately after the death and it does not remain in the grave waiting for doom’s day. And the earth consumes the body-material in due course of time) It is a rational and scientific view of Sikhism.
When Sri Guru Har Rai Ji was informed about this incident, he immediately excommunicated Ram Rai Ji from the Sikh Panth and never met him, through the later pleaded repeatedly for forgiveness. Thus Guru Sahib established a strict property for the Sikhs against any alteration of original verse in Guru Granth Sahib and the basic conventions set up by Guru Nanak Sahib.
Knowing that the end was near, Sri Guru Har Rai Ji installed his younger son Har Krishna as the Eighth Nanak and passed away on Kartik Vadi 9 (5 Kartik), Bikrami Samvat 1718, (6th October, 1661) at Kiratpur Sahib.