The time of the battle drew near. The Prophet(sa) came out of the little hut in which he had been praying, and announced:
"The hosts will certainly be routed and will show their backs."
These were the words revealed to the Prophet(sa) some time before in Mecca. Evidently they related to this battle. When Meccan cruelty had reached its extreme limit, and Muslims were migrating to places where they could have peace, the Prophet(sa) had the following verses revealed to him by God:
And surely to the people of Pharaoh also came Warners. They rejected all Our Signs. So We seized them as the seizing of One Who is Mighty and Omnipotent. Are your disbelievers better than those? Or have you an exemption in the Scriptures? The hosts will certainly be routed and will show their backs. Nay, the Hour is their appointed time; and the Hour will be most calamitous and most bitter. Surely the offenders will be in bewilderment and flaming fire. On the day when they will be dragged into the Fire on their faces and it will be said to them, "Taste ye the touch of burning" (54:42-49).
These verses are part of Surah Al-Qamar and this Surah, according to all reports, was revealed in Mecca. Muslim authorities place the date of its revelation somewhere between the fifth and tenth year of the Prophet's(sa) Call, that is, at least three years before the Hijra (i.e. the year of the Prophet's(sa) migration from Mecca to Medina). More likely, it was revealed eight years before. European authorities have the same view. According to Noldeke, the whole of this Chapter was revealed after the fifth year of the Prophet's(sa) Call. Wherry thinks this date a little too early. According to him, the Chapter belongs to the sixth or seventh year before the Hijra, or after the Prophet's(sa) Call. In short, both Muslim and non-Muslim authorities agree that this Chapter was revealed years before the Prophet(sa) and his followers migrated from Mecca to Medina. The prophetic value of the Meccan verses is beyond dispute. There is in these verses a clear hint of what was in store for the Meccans in the battlefield of Badr. The fate they were going to meet is clearly foretold. When the Prophet(sa) came out of his hut, he reiterated the prophetic description contained in the Meccan Chapter. He must have been put in mind of the Meccan verses, during his prayers in the hut. By reciting one of the verses he reminded his followers that the Hour promised in the Meccan revelation had come.
And the Hour had really come. The Prophet Isaiah(as) (21:13-17) had foretold this very hour. The battle began, even though Muslims were not ready for it and non-Muslims had been advised against taking part in it. Three hundred and thirteen Muslims, most of them inexperienced and unused to warfare, and nearly all of them unequipped, stood before a number three times as large, and all of them seasoned soldiers. In a few hours, many noted chiefs of Mecca met their end. Just as the Prophet Isaiah(as) had foretold, the glory of Kedar faded away. The Meccan army fled in miserable haste, leaving behind their dead as well as some prisoners. Among the prisoners was the Prophet's(sa) uncle, Abbas(ra), who generally stood by the Prophet(sa) during the days at Mecca. Abbas(ra) had been compelled to join the Meccans and to fight the Prophet(sa). Another prisoner was Abu’l As(ra), a son-in-law of the Prophet(sa). Among the dead was Abu Jahl, Commander-in-chief of the Meccan army and, according to all accounts, arch-enemy of Islam.
Victory came, but it brought mixed feelings to the Prophet(sa). He rejoiced over the fulfilment of divine promises, repeated during the fourteen years which had gone by, promises which had also been recorded in some of the earliest religious writings. But at the same time he grieved over the plight of the Meccans. What a pitiable end had they met! If this victory had come to another in his place, he would have jumped with joy. But the sight of the prisoners before him, bound and handcuffed, brought tears to the eyes of the Prophet(sa) and his faithful friend Abu Bakr(ra). Umar(ra), who succeeded Abu Bakr(ra) as the Second Khalifa of Islam, saw this but could not understand. Why should the Prophet(sa) and Abu Bakr(ra) weep over a victory? Umar(ra) was bewildered. So he made bold to ask the Prophet(sa), "Prophet(sa) of God, tell me why you weep when God has given you such a grand victory. If we must weep, I will weep with you, or put on a weeping face at least." The Prophet(sa) pointed to the miserable plight of the Meccan prisoners. This was what disobedience of God led to.
The Prophet Isaiah(as) spoke again and again of the justice of this Prophet(sa), who had emerged victorious from a deadly battle. Of this there was a grand demonstration on this occasion. Returning to Medina the Prophet(sa) rested for the night on the way. The devoted followers who watched him could see that he turned from side to side and could not sleep. They soon guessed that it was because he heard the groans of his uncle, Abbas(ra), who lay nearby, bound tight as a prisoner of war. They loosened the cord on Abbas(ra). Abbas(ra) stopped groaning. The Prophet(sa), no longer distrubed by his groans, went to sleep. A little later he woke up and wondered why he no longer heard Abbas(ra) groan. He half thought Abbas(ra) had gone into a swoon. But the Companions guarding Abbas(ra) told him they had loosened the cord on Abbas(ra) to let him (the Prophet(sa)) sleep undisturbed. "No, no," said the Prophet(sa), "there must be no injustice. If Abbas(ra) is related to me, other prisoners are related to others. Loosen the cords on all of them or tie the cord tight on Abbas(ra) also." The Companions heard this admonition and decided to loosen the cords on all the prisoners, and themselves bear the responsibility for their safe custody. Of the prisoners, those who were literate were promised freedom if they each undertook to make ten Meccan boys literate—this being their ransom for liberty. Those who had nobody to pay ransom for them, obtained their liberty for the asking. Those who could afford to pay ransom, were set free after they had paid it. By setting the prisoners free in this way, the Prophet(sa) put an end to the cruel practice of converting prisoners of war into slaves.