By virtue of the treaty of Hudaibia, Bani Khuzza who had declared their association with the Muslims were now considered a part of Muslims now nobody had any right to challenge them; but the Quraish in order to punish them for their friendship with the Muslims violated the treaty and asked Bani Nakr to kill them and pillage their territory. Even Suhail himself, who had signed the treaty of Hudaibia on behalf of the Quraish came to fight in disguise. Bani Khuzza begged to spare their lives but they did not listen and slew all of them. Even those who had taken refuge in Kaaba were massacred. When the refuges of Kaaba pleaded for mercy in the name of Allah, the Quraish replied there is no Allah today.
When the Prophet (S.A.W) heard the news of the gruesome killing from the forty refugees (including women and children) who had somehow reached Madina he ordered an army of ten thousand people to get ready to attack Mecca, though it was the month of Ramzan and the Muslims were fasting.
Abu Sufian who was then the governor of Mecca rushed to Madina to apologise for the killings and ask for forgiveness of the Prophet (S.A.W). But the Prophet (S.A.W) did not believe his words and ordered his men to march towards Mecca. Saad Ibne Ebada was given the command of the advance force when the Prophet (S.A.W) learned from his uncle Abbas that Saad and his men were contemplating to loot Mecca in retaliation of the massacre of Bani Khuzza, he removed him from the command and gave it to Ali (A.S.). Ali (A.S.) took his men to Marruzaharan near Mecca and camped there for the final attack. Abu Sufian seeing his end near him immediately embraced Islam, but the Prophet (S.A.W) did not believe his words again and ordered the Muslims to surround Mecca, and enter from four different points. Ali (A.S.) who was also commanding a large cavalry along with being the flag-bearer of the Muslims army was ordered to hoist the flag on Mount Hajun and wait for the Prophet (S.A.W). The other officers were also asked not to attack the Meccans first.
Ali (A.S.) as ordered reached Mount Hajun without harming anybody and hoisted the flag of Islam on it. Other generals too led their army peacefully and gathered near Ali (A.S.). When the Prophet (S.A.W) arrived, he removed his armour, but the dress of a pilgrim and wore a black turban and proceeded towards Kaaba with Ali (A.S.) to offer prayers.
There were three hundred and sixty idols inside the Kaaba representing the different pagan Arab gods. Pictures of Prophet (S.A.W) Ibrahim and his son Ismail and of angels in females form were posted on the walls of Kaaba. The Prophet (S.A.W) after obliterating these pictures broke all idols. The idol of Hubal the so-called god of Mecca could not be broken by the Prophet (S.A.W) or Ali (A.S.) as it was fixed at a high place. The Prophet (S.A.W) made Ali (A.S.) stand on his shoulders to break it. Not one person from the whole of Mecca came forward to stop Mohammad (S.A.W) and Ali (A.S.) from breaking their gods. The whole of Mecca was at his mercy. While the Prophet (S.A.W) and Ali (A.S.) were breaking the idols the Muslims were celebrating the victory of Islam on the infidels.
Addressing the Meccans who had summoned before him the Prophet (S.A.W) asked them, "What do you expect from me today?" "Mercy," they all pleaded. Tears rolled from the eyes of the Prophet (S.A.W) and he declared, "Today I will speak to you as Yusuf spoke to his brothers. I will not harm you and Allah will forgive you for He is Merciful and Loving. Go you are free." Abu Sufian who was sure than he will not be forgiven ran after every important person whom he thought could influence the Prophet (S.A.W). When nobody accompanied him he caught hold of Prophet (S.A.W)s uncle Abbas and begged him to save his life. Abbas requested the Prophet (S.A.W) to forgive Abu Sufian, and the Prophet (S.A.W) did not turn down his uncles request, and freeing Abu Sufian said "Go you are a freed slave."
After the conquest of Mecca the Prophet (S.A.W) sent some of the Muslims as missionaries to visit the small hamlets of non-Muslims near Mecca and invite them towards Islam. He had given specific orders not to harm anyone but Khalid Bin Waleed who had embraced Islam only after the fall of Mecca chose the occasion to take the revenge on his infidel uncle from Bani Jazhima who were all Muslims. When the people of Bani Jazhima learned about Khalid Bin Waleeds coming they came out of their hamlets to meet him but armed. Khalid knowing fully well that they were Muslims asked them who they were. The people of Bani Jazhima said that they were Muslims and followed the teachings of Mohammad (S.A.W). They also informed him that they had built a mosque in which they recite Azaan and offer Namaz. When Khalid could not find any other excuse to kill them he asked them as to why did they come armed to meet him. They replied that they mistook him and his men to be some other clan with whom they did not have good relations. Khalid did not accept this explanation and ordered them to surrender their arms, which they immediately did. Khalid then ordered his men to tie their hands behind their backs. When their hands were tied Khalid beheaded all of them.
When the Prophet (S.A.W) learned about the killings of Muslim by Khalid, he was so angry and agitated that thrice he prayed, "O Allah I deplore Khalids action." Then he sent Ali (A.S.) to compensate the survivors for their losses and to return all that Khalid had looted. Ali (A.S.) enquired from every person of Bani Jazhima of his or hers losses and sufferings and gave all what they asked for. When every person was paid to his satisfaction and there was still some money left, Ali (A.S.) redistributed it to all of them. When the Prophet (S.A.W) was informed about the way Ali (A.S.) handled the sufferers of Bani Jazhima he appreciated Ali (A.S.)s generosity.