A situation now arose which would require the Guru's complete attention. Reports came to the Guru that Prithi Chand was composing his own hymns and was passing them to the visiting Sikhs as the compositions of Guru Nanak as well as other Guru's. Others were also passing of their own compositions as the works of the Sikh Guru's. Guru Arjan realized that if this situation was allowed to continue it would be the undermining of the Sikh religion. Having given the Sikhs a central place of worship, they now needed an authentic compilation of the hymns of their Guru's. Thus Guru Amar Das started collection the original verses of all the Guru's. He sent trusted Sikhs such as Bhai Piara, Bhai Gurdas and Baba Buddha across the country in search of original manuscripts. Guru Arjan made trips to Goindwal, Khadur and Kartarpur to visit the families of the previous Guru's. Guru Arjan collected original manuscripts of the Guru's from Mohan (son of Guru Amar Das), Datu (son of Guru Angad) as well as Sri Chand (son of Guru Nanak). Putting Baba Buddha in charge of the spiritual needs of the large number of pilgrims visiting Harmandir Sahib, Guru Arjan now pitched a tent by the side of Ramsar tank and started the arduous task of compiling the first edition of the Holy Guru Granth Sahib. Bhai Gurdas was entrusted as the Guru's scribe for the master copy. Unlike any other religious book in history, Guru Arjan decided to also include the compositions of Hindu and Muslim saints which he considered consistent with the teachings of Sikhism and the Guru's. Guru Arjan included the works of such Hindu Bhaktas as Kabir, Jaidev, Namdev, Dahnna, Ravidas, Pipa and Ramanand. The Guru also included the works of such Muslim divines as Farid, Mardana, Satta and Balwand, the Guru's minstrels, as well as several bards (Bhatts). Bhai Gurdas was invited by the Guru to include his own verses, but declined out of modesty.
The monumental task was finally completed. This first edition of the Guru Granth Sahib known at that time as Pothi Sahib was installed on a high pedestal within the Harmandir Sahib in August 1604. Guru Arjan seated himself at a lower level and instructed all Sikhs to bow before it, not as an idol, but as the book of divine inspiration which instructed living men in the ways of God and dedicated secular life. The revered Baba Buddha was appointed the first Granthi (custodian) of the book. Guru Arjan dictated that unlike the Hindu scriptures, the Pothi Sahib could be open to reading by anyone of any caste, creed or sex. This original copy is still in existence today.
A rich arrogant Hindu banker of Delhi called Chandu Shah tried to marry his daughter to Hargobind. But due to his arrogance Guru Arjan refused the match. Prithi Chand knew that Chandu Shah welded some influence with the imperial court. He used Chandu Shah's anger at being rejected to cause further trouble. Prithi Chand had Chandu Shah complain to the Emperor Akbar that the Guru had prepared a book which was derogatory in nature to Muslim's and Hindu's. Upon hearing this Akbar ordered the Guru to be brought before him along with the. Guru Arjan sent the revered Baba Buddha and Bhai Gurdas to the Mughal court along with a copy of the Holy Granth. Akbar opened the Holy Book and the first hymn read out was;
"My God has breathed His Light into the dust. And so brought the world into being. He it is who created the sky, the earth, the waters and all vegetation. O man, whatever one sees, passes away. But the world usurps anothers due and is forgetful of God. It is the world of the animal, nay, of ghosts and goblins. It eats the forbidden fruit, usurping what belongs to another. Hold thy mind, O man, or God will burn thee in the fire of Hell. Thy benefactors, thy brothers, thy courts and kingdoms and thy homes. Are of no avil to thee, when seized thee the Angel of Death. My Lord, purest of the pure, knows all that is within thee. Nanak: pray thou to His Saints that they lead thee on the Truth Path." (Tilang)
Upon hearing this Akbar was satisfied as he had always looked upon the Sikh Gurus as social reformers and believed in the unity of God and the brotherhood of man. However Chandu Shah accused Bhai Gurdas of not really read the text but recited a hymn from memory. Akbar therefor got one Sahib Dyal who could read Gurmukhi to appear before the court and opened a page at random for him to read, he read the following;
"You don't see God who dwells in your heart. And you carry about an idol around your neck. A nonbeliever, you wander about churning water, And you die harassed in delusion. The idol you call God will drown with you. The ungrateful sinner. The boat will not ferry you across. Says Nanak, I met the Guru who led me to God. He who lives in water, earth, nether region, and firmament. " (Sulhi)
The Emperor now exclaimed; "Excepting love and devotion to God, I so far find neither praise nor blame to anyone in this Granth. It is a volume worthy of reverence." Not only this but Akbar wanted to offer Guru Arjan a suitable gift. Guru Arjan asked the Emperor to instead exempt the people of Punjab from the annual land revenue that year since their was a severe drought. Akbar graciously complied with the Guru's wishes, this greatly increased the Guru's popularity with the peasants.
On October 17, 1605 Akbar died and was succeeded by Jahangir as Emperor. Jahangir was a person of lax morals, pleasure loving and fond of drinking. He left much of the administration duties of running his kingdom to others. Because of his lax morals Jahangir set out to please the orthodox Muslim clergy which he knew did not approve of his actions, or the tolerant attitude that his father Akbar had previously displayed to other religions. Jahangir wrote the following in his memoirs called Tuzak-i-Jehangiri; "At Goindwal on the banks of the river Beas, lived a Hindu, Arjan by name, in the garb of a Pir or Sheikh. Thus, many innocent Hindus and even foolish and ignorant Muslims he brought into his fold who beat the drum noisily of his self-appointed prophethood. He was called Guru. From all sides, worshippers came to offer their homage to him and put full trust in his word. For three or four generations, they had warmed up this shop. For a long time I had harbored the wish that I should set aside this shop of falsehood or I should bring him into the fold of Islam." Jahangir further writes; "In these days, Khusro (Jahangir's rebel son) passed through this way. The foolish person resolved to call on him. Khusro halted for a time at this place and this man came to see him and discoursed with him on many matters and also applied with saffron on his forehead what the Hindus call kashkeh (tilak) and consider a good omen. When I heard this account personally, I knew about his false pretenses. So I ordered that he be brought into my presence, that his property be confiscated and his sons and other possessions be made over to Murtaza Khan and he be dealt with in accordance with the political and common law of the land."
When Guru Arjan received the summons to appear before Jahangir, he knew that it was not a good sign. The Guru declared that his son Hargobind should be installed as the next Guru. Prominent Sikhs gathered and revered Baba Buddha applied the saffron mark on Hargobind's forehead anointing him as Guru Hargobind.
Upon reaching Lahore, Jahangir demanded that Guru Arjan revise the Holy Granth, removing all references to Islam and Hinduism. This of course the Guru refused to do. Since Jahangir was on his way to Kashmir, he asked Murtaza Khan to deal with the Guru.
Murtaza Khan immediately jailed the Guru, and ordered the Guru Arjan to be tortured to death if he did not agree to remove the alleged derogatory references in the Holy Granth. The Guru was cruelly tortured. He was made to sit on a red hot iron sheet. They poured burning hot sand on his body. The Guru was dipped in boiling water. The bore all of these brutalities with calm serenity, for five long days he was tortured. When the torturers found the Guru unresponsive to their torture they did not know what to do. On May 30, 1606 the Guru asked for a bath in the river Ravi by the side of the Mughal fort. Thousands of followers watched the Guru who could barely walk make his way to the river with tears in their eyes. His bare body was covered with blisters, Guru Arjan repeated over and over; "Sweet is Your will, O God; the gift of your Name alone I seek." The Guru then calmly walked into the river bank, bidding his farewell to his followers and was gone forever, his body carried away by the currents. This act of brutality in ending such a saintly life with such cruelty was to forever change the course of Sikhism.