An army of three thousand infantry and two thousand cavalry was recruited. The tribes of Bani Thiama and Kinan promised to support them. The flag was given to Talha ibne Talha the bravest of all. Carrying the idol of Hubal, Abu Sufian marched his army towards Madina in the month of Shawwal. His wife Hinda accompanied the army with her band of young ladies, entertaining, luring, insisting and encouraging the soldiers.
The Prophet (S.A.W) who was earlier informed by his uncle Abbas from Mecca about the unpending attack (Abbas had not migrated till then), collected all his men to defend Madina. Though they were only seven hundred, but the Prophet (S.A.W) took them at the foot of Mount Ohad. And keeping the hill behind them he divided these men into three groups having one leader each. Then he made three flags and gave one flag to each of the two clans of the Mohajirs. Aseer bin Hazeer received the flag on behalf of Aws clan, and Habab bin Manzar got the flag on behalf of Khazraj clan. Ali (A.S.) as usual was the chief flag bearer of the entire army, and Hamza was made the commander of the armoured division.
Abu Sufian too divided his army into three divisions and appointed Khalid ibn Waleed, Akrama ibn Abi Jahal and Amr ibn Aas as their commanders. The three divisions of Abu Sufian moved in the form of a semi circle towards the Muslims. Talha bin Talha coming out of his army challenged the Prophet (S.A.W) and said, "O Mohammad you say that who ever dies at your hands goes to Hell and who ever dies at our hands goes to Heaven. Now send those who want to go to Heaven." Ali (A.S.) rushed out of his army and gave him such a blow that he reeled and fell. Finding Talha helpless Ali (A.S.) walked away. His friends pleaded not to leave his bitterest enemy alive. Ali (A.S.) replied, "Enemy or no enemy, now he cannot defend himself, and I do not strike a man who cannot defend himself." But Talha succumbed to injuries Ali (A.S.) had inflicted. Talhas death brought his four sons and grandsons before Ali (A.S.), but whosoever came forward with the flag of the infidels was killed by Ali (A.S.). When nine flag bearers of the same clan were slain and there was not male left to carry the flag, a woman came forward and took the flag away. (Talha ibn Talha was the traditional flag bearer of Quraish).
A general encounter then took place in which Ali (A.S.) and Hamza carried the day and the Muslims became victorious. But the eagerness to collect the spoils of the war threw them into disorder. Ali (A.S.) however tried to stop them, but they did not listen. Khalid bin Waleed seeing the Muslims in disarray attacked them from behind, catching them unawares. The fleeing Meccans encouraged by Khalids success and Muslims confusion turned back and started attacking them from front. This double attack of the Meccans confused the Muslims so much that they could not differentiate between their friends and foes that they began to attack their own people. Seeing danger to their own lives many famous companions of the Prophet (S.A.W) like Abu Bakr, Umar bin Khattab, Usman bin Affan, Aqba, Saad bin Abi Waqas left the Prophet (S.A.W) alone surrounded by the enemies and ran for their lives. [Tabari, Suyooti, Imam Fakhruddin Razi] Usman, Aqba and Saad bin Abi Waqqas fled to Awas and returned after three days, and some went back to Madina. Umar describing his flight from the battlefield said, "I ran for my life and climbed the hill. My condition at that time was such that I was skipping and hopping like a hill-goat." [Allama Balaazari] Only ten people were left with the Prophet (S.A.W) in the battle field. They were Ali (A.S.), Hamza, Abu Rajana, Zakwan, Talha, Zubair, Haris bin Samah, Habab bin Manzar, Aasim bin Saabit and Salil bin Hanif. These ten people jointly pledged to the Prophet (S.A.W), that they will not leave him till their death. [Tafseer-e-Kabeer, Vol. 3, Page 108]
It was during this period when each one of these brave soldiers were facing hundred of people that the negro slave whom Hinda, the wife of Abu Sufian had hired to kill Hamza attacked him from far killing him instantly. On hearing the news of Hamza being killed Hinda rushed to the battlefield and getting Hamzas body, cut remove his liver and started chewing it. She also got a garland prepared from the limbs of Hamza and wore round her neck then got his body trampled and mutilated by horses. She was happy that the killer of her father had been killed.
Khalid bin Walid who was attacking and pushing the Muslims reached the place where the Prophet (S.A.W) was fighting. He attacked the Prophet (S.A.W) with a javelin and Otba threw a stone cutting the Prophet (S.A.W)s lips and breaking his two teeth. An arrow was also thrown at him which brought him down from the horse in one of the ditches the enemies had dug. As the Prophet (S.A.W) fell, Khalid bin Walid cried, "The lying Prophet is slain, the lying Prophet is slain." On hearing this cry Ali (A.S.) rushed to search the Prophet (S.A.W). He saw him lying in the ditch bleeding and Khalids men trying to kill him. Ali (A.S.) fought and chased the attackers away. Then carrying the Prophet (S.A.W) on his back and keeping the attackers at bay with his sword he brought the Prophet (S.A.W) to a safe place near a hillock. Perspiring with rage the Prophet (S.A.W) asked, Ali (A.S.) as to why did he not flee with the others. Ali (A.S.) replied, "Should I become an infidel after having embraced Islam? I am pledged to thy obedience I have nothing to do with the fugitives." The rumour of Prophet (S.A.W)s death was carried to Madina by the fleeing Muslims and his daughter Fatema (S.A.) leaving her one month old child Hasan (A.S.) in Madina rushed to the battlefield to look after her father.
Leaving the Prophet (S.A.W) on the hillock, Ali (A.S.) returned to the battlefield fighting and calling the Muslims to return and fight. He was also declaring that the Prophet (S.A.W) is very much alive. Hearing the news of the Prophet (S.A.W) still being alive many Muslims returned. Abu Bakr being one of them. [Tareekhul Khulafa, Page 25] When they saw the Prophet (S.A.W) alive and being nursed by his daughter Fatema (S.A.) they gained courage and organising themselves once again under the command of Ali (A.S.) fought and chased the enemies out of the battlefield. Seventy Muslims died in this battle and the biggest sufferers were the Prophet (S.A.W) and Ali (A.S.). They not only lost their uncle Hamza but many other brave sons of Bani Hashim. It is said that it was in this war and this occassion that the cry "La Fata Illa Ali La Saif Illa Zulfiqar" (There is no youth but Ali (A.S.) and no sword but Zulfiqar -the sword of Ali (A.S.)) was heard. From that day it has become a slogan of the Muslims which they pronounce at the time of their struggle and fight. This slogan gives them determination and courage.
The Quraish before fleeing from the battlefield ran their horses on the dead bodies of the Muslims. Abu Sufian thrusting his lance in the mouth of Hamza said, "Now taste (the revenge of your father)."
The Prophet (S.A.W) standing on the graves of the martyrs declared, "Visit the graves of the martyrs of Ohad and salute them so long as the earth and heaven exist. They are the martyrs of whose faith I bear witness." Abu Bakr hearing this declaration from the Prophet (S.A.W) asked, "Have we not participated in the holy wars with you?" The Prophet (S.A.W) retorted, "But who knows how you are going to behave after me" [Mawatta of Imam Malik Bin Anas page 174].
When the Prophet (S.A.W) reached Madina he heard the cries of the ladies of Bani Mashal. They were weeping on the death of their dear ones who had lost their lives in this war. This saddened the Prophet (S.A.W) more for there was none to weep on the death of his uncle Hamza. Saad Bin Maaz rushed to the ladies of Bani Mashal and told them the feelings of the Prophet (S.A.W). The ladies stopped their cry and rushed to the house of the Prophet (S.A.W) to mourn Hamza. From that day the ladies made a practice for weeping Hamza first and then for their relatives.
The Prophet (S.A.W) had hardly felt relieved when the news of another impending attack was received. To stop the invaders outside Madina the Prophet (S.A.W) marched his soldiers to Ahmerul Asad. The flag was again given to Ali (A.S.). But the invaders retreated and the war was averted.
In the same year Ali (A.S.) lost his mother Fatema (S.A.) Binte Asad. It was she who had brought up Prophet (S.A.W) when he lost his mother at the age of eight years. She was like a mother to him, when she died the Prophet (S.A.W) covered her body with his own shroud (Kafan) and laid her to rest. He dictated to her last words (talqeen).
After the Prophet (S.A.W) and his followers had settled in Madina the Prophet (S.A.W) signed a peace treaty with the Jews of Madina and its surroundings to enable both of them to live in peace. A code of conduct was prepared which was binding on both the parties. But the Jews were now restive because of the respect the Muslims had gained due to the teachings of the Prophet (S.A.W). They wanted to get out of the agreement and break the contract. Their leader Umro Bin Ummaiya killed two Muslims of Bani Aamir. The Prophet (S.A.W) approached them for the compensation of the deceased persons as it was mutually agreed. But Jews instead of paying the compensation to the Prophet (S.A.W) planned to kill him. They hid a man with a big stone on their roof-top who would throw it on the Prophet (S.A.W) when he entered their house to receive the compensation. The Prophet (S.A.W) got the air of this plan and ordered the Jews to leave Madina within ten days, as Madina could not be a place for the traitors. The Jews at first agreed to leave Madina but on the assurance and strength of Abdullah Bin Sulool refused. The Prophet (S.A.W) himself took the task of ejecting them. The flag for this mission was again given to Ali (A.S.). The Prophet (S.A.W) ordered his men to pitch their tents opposite the houses of the Jews. In the night a famous archer named Guzool shot an arrow on the tent of the Prophet (S.A.W). But the Prophet (S.A.W) was not hurt. The Prophet (S.A.W) to avoid trouble ordered to shift the tents to a safer place near a hill. Suddenly the Muslims found Ali (A.S.) missing. They went to the Prophet (S.A.W) to find out where Ali (A.S.) was. He told them that Ali (A.S.) must have gone for some work. After sometime Ali (A.S.) came with the severed head of Guzool and put it near the feet of the Prophet (S.A.W). When the Prophet (S.A.W) enquired Ali (A.S.) said, "I got suspicious of their intentions and I quietly walked up their houses to watch their activities. I saw this Guzool and nine of his companions with open swords in their hands preparing to attack you. I challenged them and succeeded in killing this man. The rest ran away. The Jews then fled to Khaiber."
In the same year the Prophet (S.A.W) had to face some small skirmishes like the battle of Zatur Raaqa and the second battle of Badr. Ali (A.S.) was the flag bearer of all these battles. Husain (A.S.) the second son of Ali (A.S.) was born in this year.