Shiites commentators believe that Prophet Muhammad (P.B.U.H&H.P) was appointed on 27th of Rajab, five years after the rehabilitation of Kaaba. He was forty years old at that time.
Prophet Muhammad (P.B.U.H&H.P) had come to Haraa cave as usual to say prayers and meditate. On 27th of Rajab, Gabriel (one of the four superior angels who was ordered by Allah (S.W.T) to convey revelation to prophets) descended to him. Gabriel shook Prophet Muhammad’s (P.B.U.H&H.P) arm and said: “O Muhammad! Read!” He replied:” What shall I read?” Gabriel recited the beginning verses of Chapter (Surah) al-Alaq:
“In the name of Allah, the compassionate, the merciful. Read in the name of your Lord who has created. Has created man from a leech [Spermatozoa]. Read and your Lord is the most honourable, who taught (to write) with the pen; taught man what he knew not.”
Some great events happened at the time of Prophet Muhammad’s (P.B.U.H&H.P) appointment. For instance, a groan was heard. Imam Ali (A.S) says about that: “I heard Satan’s groan when the first revelation was descended. I asked the Prophet: “What was that?” He answered: “it was Satan, who got disappointed by not being obeyed.” He also said: “You hear what I hear and see what ever I see; except you are not a prophet. You are my assistant and you will never leave the right way.”
As mentioned before, Imam Ali (A.S) accompanied Prophet Muhammad (P.B.U.H&H.P) in different cases such as his seclusion periods. This narration, written in Nahj al-Balaghah, implies that he was with Prophet Muhammad (P.B.U.H&H.P) when revelation was descended for the first time. It is inferred through the history that he was the only person with Prophet Muhammad (P.B.U.H&H.P) at that time. Nobody else has claimed to be with Him then.
Gabriel ascended after conveying revelation and accomplishing his job.
Return from cave Haraa
After this revelation, Prophet (P.B.U.H&H.P) returned to His home in Mecca. When he arrived home, he explained the story of his appointment to his wife. Khadijah (S.A), who had recognized the Prophet’s (P.B.U.H&H.P) dignity and truthfulness for years, said: “By God, it is a long time that I have been waiting for this very day; and I was hoping that one day you would become the Leader and the Messenger of these people.”
The descent of Chapter (Surah) al-Muddathir
In the first days of Prophet’s appointment, while he was resting, Gabriel descended and read the first verses of Chapter al-Muddathir.
This Chapter of the Holy Quran contains verses, which say that from then on, the Prophet had to pay all his attention to warn people to obey Allah (S.W.T). Therefore, the first verses of the Holy book of Islam were revealed to Prophet and he was assigned to be the Messenger of Allah (S.W.T).
Ref: Islamic Roshd Website