How did Muhammad eventually return to Mecca as its ruler?

The Meccans began to believe in Islam and welcomed him back.
Muslim armies conquered Mecca after Medina was invaded.
Muhammad made a pilgrimage to Mecca called the Hijrah.
God told Muhammad through Gabriel to go back to Mecca.

The correct answer is Muslim armies conquered Mecca after Medina was invaded. After years of struggle and battles, Muhammad and his followers were able to conquer Mecca and establish Islam as the dominant religion in the city. This event is known as the Conquest of Mecca and took place in 630 CE. Muhammad ultimately returned to Mecca as its ruler and was able to spread the message of Islam throughout the Arabian Peninsula.