Muslims believe the Qur'an was first revealed to Muhammad by the archangel Gabriel in a cave on the mountain of Hira in Mecca, and then over a period of twenty-three years until his death. The Qur'an was not written all together in book-form while Muhammad was alive; it was kept by oral communication and brief written records. The prophet did not know how to read nor write, but according to Muslims, the prophet's cousin Ali ibn Abi Talib, among others, used to write the texts on something when Muhammad was alive. After prophet Muhammad died, Omar ibn Khattab, one of the khulafa u rashidan, compiled the Qur'an into a single book.