Guru Har Rai was born on January 16, 1630 in Kiratpur to Baba Gurditta the eldest son of Guru Hargobind. From a very young age he exhibited a sensitivity to all living things and endeared himself to his grandfather Guru Hargobind. One day while young Har Rai was returning home he got off his horse upon seeing Guru Hargobind and in his hurry his robe got caught in a bush and some flowers were broken from their stems. It is said that it pained Har Rai's heart so much that he started crying. At the age of 14 after having received suitable training Har Rai was invested with the Guruship by his grandfather Guru Hargobind shortly before his death in March 1644. Like Guru Hargobind, Guru Har Rai kept a contingent of 2,200 cavalry as his personal guard. After the many battles of Guru Hargobind, the times of Guru Har Rai were a time of consolidation for the Sikh community without any major battles in the Gurus lifetime.
The Guru was fond of hunting but due to his sensitive nature he would not kill the animals but keep them as pets in his zoo. Once while in the forest the Guru came upon a large snake basking in the sunlight. Pointing to it, Guru Har Rai exclaimed, "This serpent might as well have been a pundit in his previous life; beautiful to behold in his dress, but the knowledge he has is to bite. Men also bite others through jealousy; even when they teach about God it is not through love or self-surrender, but through the sharp wits and poisonous fangs of controversy and argument." Guru Har Rai spent his life at his birthplace of Kiratpur. Guru Har Rai would spend the mornings and evenings listening to devotional music and giving lectures on the writings of the Gurus. The Guru would also eat simple food which was earned by the labour of his own hands. Followers from far would come to Kiratpur to seek the blessings of Guru Har Rai. The Guru continued to spread the message of Sikhism. He sent Bhagwan Gir to eastern India to preach Sikhism. Another disciple Bhai Pheru was sent to Rajasthan and Suthre Shah was appointed to Delhi.
When mughal emperor Shah Jehan's eldest son Dara Shikoh was seriously ill, Guru Har Rai sent a herbal medicine which cured him. Thus relations with the mughals remained on a good footing for a short time. There was eventual unstability in the Delhi royal court when Shah Jehan fell ill and his second son Aurangzeb aligned himself with his youngest brother Murad against their eldest brother Dara Shikoh, Shah Jehan's approved successor. Aurangzeb imprisoned his father in Agra and his soldiers as well as those of his youngest brother Murad forces Dara Shikoh to flee towards Punjab. Guru Har Rai was visiting Goindwal in June 1558 and here he met Dara Shikoh who had come to receive his blessings. Dara Shikoh remembered that the Guru had been responsible for saving his life when he was sick. Dara Shikoh was both an intellectual and liberally tolerant towards other religions. He was a great admirer of the muslim Sufi Saint Mian Mir who was in turn a great admirer of the Gurus. Guru Har Rai granted Dara Shikoh an audience and received the prince with due courtesy. After some time Dara Shikoh was eventually captured by the forces of Aurangzeb. Aurangzeb had Dara Shikoh executed, then killed his own youngest brother Murad and appointed himself as the emperor.
With such a ruthless person on the throne in Delhi, relations with the Sikhs would never be the same during Aurangzeb's long reign. Once settled into the throne, Aurangzeb turned his attention to the new faith, Sikhism. It was reported to the emperor that Guru Har Rai has had blessed Dara Shikoh and assisted his escape. Aurangzeb ordered the Guru to appear in the royal court of Delhi. Guru Har Rai did not go himself but instead sent his son Ram Rai to meet the emperor. Before leaving Ram Rai was instructed by his father to not engage in any miracles and to not allow the teaching of the Sikhs to be compromised in any way. When Ram Rai presented himself before the royal court he was able to impress Aurangzeb with his intellect and charm that Sikhism did not present any threat to the Mughals. Aurangzeb took exeption to a verse in the Guru Granth Sahib;
"God alone knows who burns in hell (the Hindu or the Muslim), for (like the Hindus whom fire consumes here), the earth of the Muslim graves also suffers being fired by the potter who fashions bricks and vessels out of its clay." (Guru Nanak, Asa Var)
Ram Rai explained to Aurangzeb that the words of Guru Nanak had been incorrectly written by the scribe, and that the word was not "Muslim" but "Baiman" (meaning faithless). By intentionally changing the words of Guru Nanak, Ram Rai was able to gain the emperors friendship. When it was reported back to Guru Har Rai what his son had done, he was deeply hurt. The Guru exclaimed, "Ram Rai was a genuine claimant for my throne. But the Guruship is like the milk of a tigress which can only be contained in a cup of gold. Now Ram Rai shall never see my face again." Ram Rai never saw his father again but maintained his friendship with Aurangzeb.
Since Ram Rai had proved a disappointment to his father, Guru Har Rai appointed his younger son Harkrishan as the next Guru and passed away soon thereafter on October 6, 1661.