Summarize this text:

Twice assassins were sent to Muhammad, but he was able to convert both of them. In a battle between the Muslims of Medina and the Quraysh army from Mecca, Muhammad was wounded. He was angry after the defeat, but a revelation warned him to ban mutilation of prisoners. Some of Muhammad's wives died, and he received a revelation that the prophet was allowed to have more than four wives. Other than 'A'isha, all the women he married were widows. Jews joined the anti-Muslim alliance, and the Muslims were besieged at Medina; but the prophet authorized the use of deception in war, keeping the Qurayza out of the alliance. Then the prophet ordered the Muslims to besiege the Qurayza for breaking their treaty.

Muhammad was able to make an unarmed pilgrimage to Mecca in 628 as he gained a truce for ten years, enabling the Muslim community to more than double in the next two years. Muhammad sent messages to the Persian emperor Khusrau, the Byzantine emperor Heraclius and the patriarch at Alexandria. The Persian viceroy Badhan in Yemen was converted when the prophet's messengers correctly informed him that Khusrau had been killed. Muhammad marched against the Khaybar Jews; though outnumbered, the Muslims were able to overcome the Jews a few at a time. The Jews of Khaybar had to surrender half their crops to the Muslims. After a minor infraction of the truce by two Quraysh, a Muslim army of 10,000 attacked Mecca and took over the city as the idols and icons were destroyed. Other towns were attacked by the large Muslim army, and Muhammad announced that slaves who joined the Muslims would be freed. In 630 he sent a Muslim army of 30,000 that included 10,000 cavalry to attack Byzantine Syria, but he made peace treaties with Christian and Jewish communities along the Gulf of 'Aqabah coast. Muhammad sent officials to collect taxes to support the poor. On his last pilgrimage to Mecca the prophet banned pagans from participating. Muhammad married eleven times and died of illness on June 8, 632.

The text summarizes the significant events and actions of Muhammad, the prophet of Islam. It includes his encounters with assassins, battles with opposing forces, marriages, alliances with various groups, conquests of cities, and administrative decisions. It also discusses his diplomatic efforts, economic policies, and final pilgrimage before his death in 632.