Guru Arjan, the fifth Guru, compiled the Adi Granth at Amritsar, completing it in 1604 with Bhai Gurdas as scribe. He had reason to act. Hymns were circulating in collections of uneven reliability, and rival claimants to the succession were putting their own compositions into circulation as the Gurus' work; a fixed authorised text settled the question. Arjan gathered the hymns of his four predecessors, added his own, incorporated the bhagat bani, and imposed the raga arrangement. The volume was installed in the Harmandir Sahib at Amritsar, with Baba Buddha as its first custodian. The manuscript held at Kartarpur, near Jalandhar, is traditionally identified as that original, the Kartarpur Bir, and its status has been debated by scholars.
Arjan was executed in Lahore in 1606 under the Mughal emperor Jahangir, the first of the Gurus to be killed. The volume he compiled did not then change for a century.
The final recension came from Guru Gobind Singh, the tenth Guru, at Damdama Sahib in 1706, dictated to Bhai Mani Singh. Its one substantive addition was the hymns of his father, Guru Tegh Bahadur, executed at Delhi in 1675. Gobind Singh added nothing of his own; his compositions are collected separately in the Dasam Granth, which has a different and contested standing. Then, at Nanded in the Deccan on 20 October 1708, shortly before his death, he ended the line of human Gurus and conferred guruship on the scripture. From that point the community's authority rests on the Guru Granth Sahib as the living and eternal Guru, together with the collective body of the Khalsa, a settlement made deliberately, in the presence of the Sikhs, and not a doctrine that developed afterwards.