Prophet Muhammad (pbuh) became ill after he had returned to Medina from the Farewell Pilgrimage. During these days, he visited the martyrs of Uhud and performed funeral prayers for them. One night, he went to the Jannatu al-Baqi graveyard and requested Allah to show forgiveness to them. Meanwhile, Aswad al-Ansi from the Mazhij tribe proclaimed his false prophethood in Yemen. Aswad marched through Sana'a with about 600 cavalry that he had collected from his tribe. He killed Shahr, the son of Basan, the first Muslim governor of Yemen, a man who had opposed Aswad. Aswad had forcibly married Shahr's wife Azad and took the control of the region. Prophet Muhammad (pbuh) sent letters to the governors of the region and prominent people to stop Aswad. Eventually Aswad was killed with the help of Azad (Rabi' al-awwal 8, 11/June 3, 632). At the same time, Musaylima al-Kadhdhab from the Banu Hanifa had sent a delegation to Medina; he apostatized after the delegation returned to Yamama and began to claim his prophethood. Prophet Muhammad (pbuh) sent him a letter, inviting him to Islam again. In his answer, Musaylima proposed a partnership with Prophet Muhammad (pbuh), claiming half the world belonged to him and the other half belonged to the Quraishis. In his reply Prophet Muhammad (pbuh) stated that the world belongs to Allah, and He lets whom He will of His creatures inherit it and it is for the pious. Musaylima was killed during the caliphate of Abu Bakr.
In the last days of the month of Safar in the 11th year of the hijrah (May, 632), Prophet Muhammad (pbuh) decided to send an army, led by Usama ibn Zayd, to the land of Byzantines to fight the Battle of Muta. The army established its headquarters in the Juruf region outside of Medina. Meanwhile Prophet Muhammad (pbuh)'s condition deteriorated and Usama decided not to march but to wait.
Prophet Muhammad (pbuh) was suffering from headaches that sometimes became unbearable and a high fever. He was leading the prayers in al-Masjid al-Nabawi during his sickness with the help of his Companions. One day, he climbed to the pulpit and said, "Behold, Allah gave to one of His bondmen the choice between this world and that which is with Him; he chose that which is with Allah." Abu Bakr understood the significance of Prophet Muhammad (pbuh)'s words, for he knew that it was Prophet Muhammad (pbuh) himself who had been given this choice. Abu Bakr broke into tears and exclaimed, "May our own fathers and mothers be your ransom". Prophet Muhammad (pbuh) calmed Abu Bakr and told him that he was pleased with him. Then, he reminded the ansars and the muhajirs of their mutual altruism and virtues and advised them to act together. Prophet Muhammad (pbuh) asked for those people to whom he owed something to take their rights. He warned people to care about the rights of the believers, to pay their debts in time, and to avoid from making his tomb into a temple like the tombs of some historical figures.
The will left by Prophet Muhammad (pbuh) to his daughter Fatima and to his aunt Safiyya is interesting. "Do good deeds that are valuable for Allah. Otherwise, I cannot save you from the judgment of Allah on issues of the lawful and the unlawful."
One of the last wills left by Prophet Muhammad (pbuh) to the Muslims contains the following points: to treat people who are under their responsibility well, to take care that the necessary preparations are made with a good conscience, as they will be held accountable before Allah, and to treat foreign messengers well and give them presents.
Prophet Muhammad (pbuh) spent his final days with Aisha; his health deteriorated three days before his death and he commanded Abu Bakr to lead the prayers. When he felt better, he went to the masjid with the help of Ali and Fazl ibn Abbas; when Abu Bakr, who was leading the prayer, saw the Prophet he wanted to retreat and give the place to Prophet Muhammad (pbuh); however, the Prophet nodded towards Abu Bakr to continue and stood next to him during the prayer. After the morning prayer of the next day he passed away; Abu Bakr visited him and when he saw that Prophet Muhammad (pbuh) was getting better, he asked for permission to go home. But the health of Prophet Muhammad (pbuh) suddenly deteriorated. According to Aisha Prophet Muhammad (pbuh) said "La ilaha illallah, how hard it is to give away your soul!" in a low voice, and then he abandoned his soul in her arms saying "ila'r-rafiq al-a‘la" (to the most divine friend) (13 Rabi'al awwal 11 / June 8th 632 Monday)
The death of Prophet Muhammad (pbuh) deeply saddened all the Muslims; some Companions, such as Umar, felt that the polytheists were happy about this situation and for this reason said that the Prophet had not died. After Abu Bakr received the news of the Prophet's death, he came before the corpse, lifted the veil that was over his face and kissed the Prophet, saying "O Messenger of Allah, may my own father and mother be your ransom! You were beautiful when you were alive; you are still beautiful though you are dead". Then, he went to the masjid and said the following: "O People! If there is anyone who wants to worship Muhammad, he should know that Muhammad has died. He who worships Allah should know that Allah is immortal" (Ibn Hisham, II, 655-656). Then he read the following verse: "Muhammad is but a messenger, messengers have passed away before him. Will it be that, when he dies or is slain, you will turn back on your heels? He who turns back on his heels will not be able to harm Allah, and Allah will reward the thankful." (Al Imrân 3/144). The body of the Muhammad was washed on Tuesday by Ali with the help of Fadl and Qutham, the sons of Abbas. The funeral prayer was not performed in a congregation; first the men, then the women and later the children came in groups before the body of Muhammad and performed the prayer one by one. In accordance with the hadith conveyed by Abu Bakr from Prophet Muhammad (pbuh), his body was put in the grave by Ali, Fadl, Qutham and Usama, which had been dug where he had died.
Prophet Muhammad (pbuh) lived a simple life, spending his wealth in the way of Allah; he left behind an extremely moderate heritage. As a matter of fact, he had said "We prophets do not leave a will. The only kind of wealth that we leave is sadaqas" (Ibn Sa‘d, II, p. 314; Buhari, "Humus", 1). When he died, he had a white mule, weapons and lands. He had ordered that the income of his lands be spent for his family and the rest be handed over to the treasury. Shortly before his death, the Prophet said that he would be embarrassed before Allah and thus commanded that his remaining 7 dirhams be distributed among the poor. Some armor that belonged to him was held in pawn by a Jew in return for his debts. The spiritual heritage of Prophet Muhammad (pbuh) is extremely great and valuable both for his ummah (community) and indeed for all of mankind. As he stated in his Farewell Sermon, Prophet Muhammad (pbuh) left us the Quran and the sunnah. The religion of Islam and Islamic civilization have been shaped around these two sources; a vast geography has been influenced for centuries and has taken its place in the history of mankind.