The Prophet Muhammad became the messenger of Allah and continued to have Allah’s word revealed to him for the next 23 years. The revealed teachings were written down by the Prophet Muhammad's close friends and followers.
The popular view amongst Muslims is that the final words of Allah to Muhammad were:
This day I have perfected your religion for you, completed My favour upon you, and have chosen for you Islam as your religion.Qur’an 5:4
After this revelation, Muhammad began to preach to the people, passing on the word of Allah. Due to this, he faced much opposition and eventually had to leave Makkah (Mecca).