Before he died, Muhammad would be recognized as a great prophet in Arabia, but the first 13 years after the visitation from Gabriel were very difficult for him and his followers. Most of the tribal leaders in Mecca opposed Muhammad's warnings from a monotheistic (only one) God. They believed in many gods and knew that Muhammad's teaching would threaten their power. They were especially angry because Muhammad's message of equality and individual accountability to God threatened the tribal system of hierarchy and group loyalty. And his message also challenged their hold on the Kaaba, or the religious shrine, in Mecca that housed their many tribal idols which, as a center of pilgrimage, made them rich.
Over the years, the oppression of Muhammad and his followers grew more harsh. Eventually the tribal leaders of Mecca hatched a plan to kill Muhammad. But before they could assassinate him, he moved a few hundred of his followers to Medina, a city about 200 miles to the north of Mecca. This move, known as the hijra in Muslim tradition, enabled Muhammad to emerge as the head of an Islamic city-state, and marks the beginning of the Muslim calendar. There Muhammad lived for the remaining ten years of his life, establishing the first rules for an Islamic society, continuing to recite the growing Qur'an, and fighting against Mecca, who sent large armies to defeat him on three separate occasions. When they could not overcome him by force, the Meccans finally signed a treaty with Muhammad. But about two years later, Muhammad declared the treaty void after an incident between the Meccans and a tribe allied to him left several of his allies killed.
http://www.theislamproject.org/education/es_islam_overview.htm