It is narrated from Sayyiduna Zayd bin Thabit (may Allah be pleased with him) that he said: At the time of the killing of the people of Yamamah, Sayyiduna Abu Bakr (may Allah be pleased with him) sent for me. I came to him and saw that Sayyiduna Umar (may Allah be pleased with him) was also seated there. Sayyiduna Abu Bakr (may Allah be pleased with him) said: "Sayyiduna Umar (may Allah be pleased with him) has come to me and told me that the reciters of the Qur'an have been martyred in the battle of Yamamah. I fear that if the reciters of the Qur'an continue to be martyred like this on various fronts, much of the Qur'an (which is only in people's hearts) will be lost. My advice is that you order the Qur'an to be compiled." (Sayyiduna Abu Bakr (may Allah be pleased with him) further said:) I said to Sayyiduna Umar (may Allah be pleased with him): "How can I do something that the Messenger of Allah (peace and blessings be upon him) did not do?" Sayyiduna Umar (may Allah be pleased with him) said: "By Allah, this is a good thing." He kept urging me about it until Allah Almighty opened my heart to that for which He had opened the heart of Sayyiduna Umar (may Allah be pleased with him), and I came to hold the same view that Sayyiduna Umar (may Allah be pleased with him) held.
Sayyiduna Zayd (may Allah be pleased with him) said that Sayyiduna Abu Bakr (may Allah be pleased with him) said: "You are a young and intelligent man, we trust you, and you used to write down the revelation for the Prophet (peace and blessings be upon him). So search out the Qur'an and gather it together." Sayyiduna Zayd bin Thabit (may Allah be pleased with him) said: By Allah, had they ordered me to move a mountain from one place to another, it would not have been as heavy and hard on me as this task (of compiling the Qur'an) seemed. I said: "Why would you do something that the Messenger of Allah (peace and blessings be upon him) did not do?" Sayyiduna Abu Bakr al-Siddiq (may Allah be pleased with him) said: "(Even though he did not do it,) by Allah, this is a good thing." He kept urging me about it, until, just as Allah Almighty had placed this in the hearts of Sayyiduna Abu Bakr and Sayyiduna Umar (may Allah be pleased with them both), He placed it in my heart too, and my view became like theirs. So I began searching for the Qur'an, and I started gathering it from palm-leaf stalks, thin stones and the hearts of men, until I found the last verses of Surah al-Tawbah, "There has certainly come to you a Messenger from among yourselves" [Surah al-Tawbah: 128] to the end of the surah, with Sayyiduna Khuzaymah or Sayyiduna Abu Khuzaymah al-Ansari (may Allah be pleased with him), and I attached them to Surah al-Tawbah. Then this mushaf remained with Sayyiduna Abu Bakr (may Allah be pleased with him) during his lifetime, then after him with Sayyiduna Umar (may Allah be pleased with him) until he passed away, then it passed to Sayyidah Hafsah bint Umar (may Allah be pleased with her).
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 2372