Prophet Muhammad was appointed as a Messenger by God when he was forty years old. After the repairs of the Ka’ba and his inserting the Black Stone back in its place, people began to notice that Muhammad tended towards thinking about God and seeking the ways of belief in and worship of Him. Not once showing any interest in the idols of the Makkans or those of the many other Arab tribes, he reached the conclusion of the futility of worshipping idols, by way of reason and conscience. It is quite possible that he was thinking along the same lines as the small number of Hanif who were trying to practice the monotheistic religion of Abraham. However, while experiencing the sorrow of not knowing what to do and how to do it, Muhammad began to take pleasure in withdrawing into solitude; as of the few years prior to his Prophethood, in the month of Ramadan, he began to retreat in the secluded cave of Mount Hira, as had done his grandfather ‘Abd al-Muttalib and other members of the Quraysh.
When Muhammad ran out of food, he would go to the city, help the poor, circumambulate the Ka’ba, take food from his home and return to the cave. From time to time, he would take Khadija with him. According to a narration from A'isha, during this period the Prophet began having "sadiq (true) dreams" and this period continued for six months; the dreams that he saw in this period became a reality one-by-one. There are also accounts in the sources that state that during this period, Prophet Muhammad heard voices greeting him with the words, "Peace be upon you, O Messenger of Allah,” but when he turned around and looked to find no one there he would thus become quite anxious; authentic narrations state that these voices came from rocks and trees. Due to the above-mentioned incidents, some of them miraculous in nature, it is possible to say that this period constituted a phase of preparation for revelation.
In the year 610, during the last ten days of the month of Ramadan, when Prophet Muhammad was in the cave of Hira, Archangel Gabriel appeared to him; it is thought that this could have occurred on the twenty-seventh night and according to some accounts on a Monday. Gabriel informed Muhammad that God had assigned him as a Prophet. This first revelation was reported by Prophet Muhammad as follows: "That night Gabriel came to me and said ‘Read (Iqra’). I responded, ‘I am not of those who read'. Upon this, the angel took me; pressed me until it was almost too much to bear. Then he released me and said, ‘Read'. I again replied ‘I am not of those who read' He embraced me again firmly and said, ‘Read'. When I responded ‘What shall I read?' the angel embraced me till I had no more strength left and after releasing me the angel read these verses to me: “Read in and with the Name of your Lord, who has created – Created human from a clot clinging (to the wall of the womb). Read, and your Lord is the All-Munificent, who has taught (human) by the pen – Taught human what he did not know." (Al'Alaq, 96:1-5). After this incident, Muhammad became anxious and fearful; he left Hira and went to his home, went to bed and told his wife Khadija to cover him. After Muhammad woke up, he told his wife what he had experienced. Khadija told Muhammad that she believed in him and reassured him by saying; "God will never disgrace you. You maintain good relations with your kin, you bear the burden of the weak, you help the poor and the needy, serve your guests generously, and assist those who are afflicted by calamity." Then she took Prophet Muhammad to Waraqa ibn Nawfal, her cousin. An old Christian Scholar well-versed in the Holy Bible, Waraqa listened to Muhammad and then told him that the being who came to him was the Angel of Revelation who was sent by God to all the Prophets. He then added: "They will call you a liar; they will treat you badly. They will wage a war against you and drive you out of this city. If I live to see those days, I will help you for the sake of Allah." After Waraqa completed his words, he leaned towards Muhammad and kissed him on the forehead. With the support of Khadija and the explanations of Waraqa, the Prophet returned to his home feeling much relieved.