Ram Rai was excommunicated from the mainstream Sikh community by his father Guru Har Rai, after he learnt that his eldest son had altered gurbani to please Aurangzeb and nominated his younger son, Har Krishan, as next-in-line for the Sikh guruship before he died on 6 October 1661.
[6][5] This had foiled the plans of the Mughal emperor, who was keeping Ram Rai as a hostage, as he had been hoping that the Sikh guruship would pass onto Ram Rai so that he could enact control over the wider Sikh community by manipulating their titular head.
[8] Ram Rai's brother, Guru Har Krishan, was the eighth of the ten Sikh Gurus.
[10] After his death, he was succeeded as head of the sect by either mahant Aud Dass[11] or Har Prasad,[4] the successor was helped by Ram Rai's widow, Panjab Kaur.
[11][note 1] Gurbakhsh became a pretender to the Ramraiya guruship at the Lahore ashram and later clashed with Khalsa Sikhs.