Khaybar, located in the vast valley which stretched from 180 kilometers to Madina’s north and on the road between Madina and Syria, was an important center of trade and agriculture populated by Jews. After the Treaty of Hudabiya, Prophet Muhammad began to take into account the threat that Khaybar posed for the Muslims. This was because the Banu Nadir Jews who settled in Khaybar after having been expelled from Madina had begun to engage in enemy activity together with other Khaybar Jews against Madina and had formed an alliance with certain Arab tribes in addition to the Makkan polytheists. The Battle of the Trench was one outcome of their enemy activities. A short time after the Prophet’s return from Hudaybiya, the Prophet decided to advance upon Khaybar and set off from Madina with a force of 1600, 200 of which were cavalry (or 300 cavalry, 1500 men) (end of Muharram/June 628). Informed of the situation, the denizens of Khaybar began to make preparations against the Muslims. According to accounts, they had 20,000 or at least 10,000 warriors. Moreover, they possessed the defensive advantage with their citadels famous for their sturdiness and had ample armaments and weaponry. At the end of the siege lasting one month and at times including fierce battles, four of the seven fortified citadels at Khaybar were annexed through battle and three through peaceful means. In the battle wherein Muslims showed great valor and tenacity – first and foremost ‘Ali who conquered Khamus, the greatest of Khaybar’s citadels – ninety three Jews and 15-20 Muslims were killed.
During the battle, many Jewish fighters were taken captive, as well as their women and children. As stated by Muhammad Hamidullah, if after the battle the judgment to be dealt had been given in accordance with the Torah, all the adult males would have been executed by the sword and the women and children given as slaves. However, Prophet Muhammad first spared the lives of all the people and then granted them permission to leave. In response, they requested permission to remain in their fields where a significant amount of dates were cultivated as partners. The Prophet accepted this proposal. After Khaybar, similar agreements were made with the communities of Wadi al-Qura' and Fadak.
A large number of animals, household goods, textiles, and jewellery were procured at Khaybar. These spoils constituted one of the greatest of the Prophet’s period, in terms of number, variety, and worth. There are various accounts in the sources regarding the amount and distribution of the personal effects and property. Manuscripts of the Torah included among the spoils were returned to their owners by Prophet Muhammad.
While the siege continued, the slave of one of the Khaybar Jews, an African shepherd, came to Prophet Muhammad and obtaining information about Islam, became Muslim and decided to participate in the battle alongside the Muslims. At this point, with the consciousness of the sheep that he was herding constituting a trust that had been given to him, he asked the Prophet what he should do with the sheep. Stating that Islam enjoined fulfilling trusts, Prophet Muhammad commanded him to herd the sheep towards the citadel of their owner and release them. The shepherd whose name is recorded as Yasir in the sources did as the Prophet commanded and, upon ensuring that the sheep had entered the citadel, returned to join the Muslims. He was martyred a short time later. Prophet Muhammad approached the martyr and informed his Companions that he was one of the people of Paradise. As such, the shepherd who had acquired the status of martyrdom without even having had the time to perform a single ritual prayer after embracing Islam became etched in memories as the answer to the question asked among the Companions: “Who is the person to enter Paradise without having performed a single prayer?”
During the conquest of Khaybar, the wife of one of the Jewish leaders, Zaynab bint Harith, slaughtered a sheep and invited the Prophet to a feast. Her real intention, however, was to poison him. Prophet Muhammad took Bishr ibn Bara’ along with him and attended this feast. But he understood from the first morsel that the food had been poisoned and removed it from his mouth before swallowing it. Bishr ibn Bara’, however, died because of the poison.
Freeing Safiyya, the daughter of Jewish leader Huyay ibn Akhtab, who was among the Khaybar captives, Prophet Muhammad took her as his wife.