In Medina, Muhammad turned into a political leader. He successfully resolved conflicts between local tribes. A number of groups in Medina accepted his leadership. This caused the Ummah to grow.
Even during his stay in Medina, Muhammad was threatened by the Quraysh. This convinced the Ummah to use force against them. Besides being a prophet and a political leader, Muhammad now became a military leader.
By 630 AD, Muhammad and his followers had become strong enough to defeat the Quraysh. They seized Mecca and removed the statues from the Ka’aba. From that moment, only Allah was worshipped in Mecca.
The struggle for God, the jihad, continued. Many tribes joined the Ummah. When Muhammad died in 632 AD, nearly all Arab tribes had recognised him as their leader.