To the north of Madinah was situated a fertile land known as the Valley of Khayber. The area was populated by 20,000 Jews who were skilled in farming and warfare. They had built seven strong forts in Khayber to protect themselves from any attack.

When the Jewish tribes of Bani Qaynqaa and Bani Nuzayr were expelled from Madinah because of their plots against Islam, some of them settled at Khayber. Here, they continued in their old ways, encouraging and helping the Arab tribes to harm the State of Islam.

Even after the Jews had lost against the Muslims in the Battle of Ahzab, they remained a source of danger to the Muslims. Moreover, the Holy Prophet (S) had sent letters to various leaders of neighbouring countries, and he was worried that those leaders who had rejected the message of Islam might pair up with the Jews of Khayber to threaten the Muslims.

Since he had just signed a peace treaty with the Quraish, the Holy Prophet (S) knew that he would have no trouble from them and he could thus concentrate on removing the danger to Islam from Khayber. He therefore ordered the Muslims to get ready to conquer the last centre of the Jews in Arabia.

The Muslim army consisted of 1,600 men, of whom 200 were mounted soldiers. The army marched out under standard of Imam Ali (A).

To stop the tribes of Bani Ghatfaan and Bani Fazarah from assisting their Jewish allies, the Holy Prophet (S) first marched towards them so that they moved away from their homes.

Then, the Holy Prophet (S) changed his direction for Khayber and by the time the two tribes realised that the real target was the Jews, it was too late for them to help their allies.

The seven forts of Khayber were named Na'im, Qamus, Katibah, Nastaat, Shiq, Watih and Sulaalim. All the forts had watchtowers with sentries posted to keep a lookout for any trouble. The forts were specially constructed to defend the entire area and the walls were equipped with weapons like giant catapults to push back an enemy attack.

The Muslim army reached the area of Khayber and after studying the situation, they occupied all the important points of access so that the Jews could not escape.

The arrival of the Muslims went unnoticed and when the farmers came out of the forts the next morning, they were shocked to find themselves confronted by an army. The Jews rushed back into the forts and held meetings to decide how to tackle the situation. Finally, it was decided to move the women and children to one fort and the food to another. This could be done because the forts were connected by underground tunnels. The Jews then planned to attack the Muslims with the best warriors from each fort.

Meanwhile the Muslims also prepared for war. The first fort of Khayber to fall to the Muslims was Na'im. In the conquest of this fort, some Muslims were killed and many were wounded. These soldiers were taken to a make-shift hospital where their injuries were treated by the women of the Bani Ghifar tribe.

The next fort that was attacked was Qamus. After a struggle, this fort was also captured. Two women who were present in the fort were arrested, one of whom was Safiyah, daughter of Hay bin Akhtab. This lady later became the wife of the Holy Prophet (S). The conquest of the two forts greatly increased the confidence of the Muslims, while the Jews became very disturbed and frightened.

As the siege of the forts continued, the Muslims began to run out of food and were forced to eat the meat of horses, which is Makruh but not Haraam to eat.

At this difficult time, one shepherd who tended the sheep of the Jews approached the Holy Prophet (S). After some discussions, he was convinced of the truth of Islam and became a Muslim. When he asked what he should do with the sheep that were in his care, the Holy Prophet (S) told him in clear terms in the presence of hundreds of hungry soldiers,
"In my religion, the breach of trust is one of the greatest crimes. Take the sheep to the gate of the fort and hand them over to their owners".

The shepherd did as he was ordered and then participated in the battle and was martyred.

By his action the Holy Prophet (S) showed clearly that he was not in Khayber to conquer land and wealth, but his aim was to remove the threat to Islam from the Jews. In spite of the needs of his men, he would not permit the unlawful use of the enemy's property and instead prayed to Allah to grant the Muslims victory over the fort where food was stored.

As days passed, one fort after another came under the hands of the Muslims. Time and time again, the heroes of Islam showed their bravery and spirit of self-sacrifice to attain the blessings of Allah.

After capturing the forts of Na'im and Qamus, the Muslims turned their attention to the forts of Watih and Sulaalim. These forts were very heavily guarded and the Muslims could not gain victory even after trying for ten days.

Both Abu Bakr and Umar led the Muslims on separate occasions to try and enter the forts but they were forced to retreat. Umar even demoralised the Muslims by praising the courage of the chief of the Jews, a fearful warrior by the name of Marhab. This action of Umar displeased the Holy Prophet (S) very much.

Finally, the Holy Prophet (S) announced a famous message. He declared,
"Tomorrow I shall give the standard to a person who loves Allah and the Prophet and who is loved by Allah and the Prophet, and Allah will accomplish the conquest of this fort at his hands. He is a man who has never turned his back to the enemy and does not run away from the battlefield".

All the soldiers were curious to learn who that person would be, and the next morning they gathered around the Holy Prophet (S) to see who would be chosen to lead the soldiers. The Holy Prophet (S) asked,
"Where is Ali?".

He was informed that Imam Ali (A) was suffering from an eye infection so severe that he was unable to see. The Holy Prophet (S) ordered that Imam Ali (A) be brought to him. When Imam Ali (A) came, the Holy Prophet (S) rubbed his eyes and prayed for his recovery. The eyes of Imam Ali (A) were instantly cured and he never had trouble with them again.

The Holy Prophet (S) then ordered Imam Ali (A) to advance against the enemy. He told him to ask the chiefs of the forts to accept Islam. If they refused he was to ask them to surrender and live freely under Muslim protection and pay tax to the Muslim state. If this offer was also refused, then he should fight.

The Jews sent out one of their best warriors, Harith the brother of Marhab, to fight the Muslims. The soldiers of Islam were struck with fear when they saw the powerful Harith advance toward them. However, Imam Ali (A) met his challenge and after a brief fight, Harith lay dead on the ground.

The death of his brother enraged Marhab. He came out of the fort fully armed and in a deadly mood. He was dressed in a heavy coat of armour and wore on his head a cap made of stone which he had covered with a helmet. As he challenged the Muslims, he recited his war poem stating,
"The walls of Khayber testify that I am Marhab. I am the best of warriors and those who face me in the battlefield are coloured with their own blood."

Imam Ali (A) stepped forward and recited his own poem, stating,
"I am the person whose mother named him Haidar, a wild lion. In battle I make short work of my enemies."

The words of Imam Ali (A) were carefully chosen. He knew that Marhab had been recently having bad dreams about being ripped apart by a lion and his words therefore caught Marhab by surprise and disturbed him. However, Marhab advanced with a terrible fury, determined to use all his skill to avenge his dead brother.

The blows of the two warriors struck awe in the hearts of the onlookers. Suddenly Marhab plunged his three-pronged lance towards Imam Ali, who avoided the thrust and struck a powerful blow to the head of Marhab. The sword of Imam Ali (A) broke through the helmet, stone cap and head of Marhab and finally stopped at his teeth.

A silence fell as the Jews unbelievingly watched their champion fall dead. As he shouted "Allahu Akbar!" in victory, Imam Ali (A) was surrounded by several experienced Jewish soldiers. However, they could not match his skill and soon they lay dead.

During the fight someone struck a blow at Imam Ali (A), breaking his shield. He turned to the gate of the fort and wrenched it off its hinges and used it as a shield. When he finally threw it away, even 10 Muslims could not lift it. Imam Ali (A) later commented that he had lifted the gate by the strength granted to him by Allah due to his firm faith in the Day of Judgement.

As a result of the bravery of Imam Ali (A), the fort was taken and soon all forts were within the hands of the Muslims. The Muslims lost 20 men in this battle while the Jews lost 93 men. The Holy Prophet (S) had made the Jews realise how useless it was to plot the downfall of the Muslims. After the victory he restored all their land to them with the orders that half of the profit from their agricultural activity should be given over to the Muslims in return for protection.

The Jews however, did not forget their humiliation at the hands of the Muslims. After their defeat, a Jewish woman by the name of Zainab brought some lamb meat as a gift for the Holy Prophet (S). The meat was poisoned and the Holy Prophet (S) ate only a little bit, but that poison had an effect on his health in the long term and when he was on his death bed a few years later, he said that his illness was partly due to the poison he had been given at Khayber.

On the day of the victory, the Muslims who had migrated from Makkah to Abyssinia returned home. The Holy Prophet (S) was overjoyed and commented that he did not know what pleased him more - the victory at Khayber or the return of his cousin Ja'far bin Abu Talib with the Muslims from Abyssinia.