The last years of Gobind Singh's life were years of catastrophe and of a decisive settlement. In the siege and evacuation of Anandpur he lost all four of his sons, the sahibzade: the two elder killed in battle at Chamkaur, the two younger, aged roughly seven and nine, executed at Sirhind for refusing conversion, and his mother, Mata Gujri, dying in the same days. From this extremity he addressed to Aurangzeb the Zafarnama, the "epistle of victory," a defiant verse letter asserting the justice of his cause.
Before his death at Nanded in 1708, from the wound of an assassin, he made the settlement that closed both the succession and the canon. He completed the scripture, adding his father's hymns to Arjan's compilation, and then ended the line of human Gurus, declaring that Guruship would pass not to any living person but to the scripture itself, thereafter revered as the Guru Granth Sahib, together with the collective authority of the community, the Guru Panth. With that act the ten-Guru line reached its intended term, and the Sikhs became a people whose Guru is a book.