Most of the Banu Nadir Jews had resettled in Khaybar. Together with them, the Jews of Khaybar continued to work against Islam in league, at various times, with either the Quraysh or the Banu Ghatafan. The Banu Nadir had been instrumental in forming the 20,000-man anti-Muslim alliance defeated during the Battle of the Trench. Seeking to end this continually hostile Jewish presence so that Arabia could be made secure for the future and free preaching of Islam, the Muslims acted.
The Banu Qurayza's punishment roused the Jews of Khaybar to ally themselves with the Banu Ghatafan and attack Madina.  They were making preparations for this when, after the treaty of Hudaybiya, the Messenger marched upon Khaybar. He made as if to attack the Banu Ghatafan, and forced them to shelter in their confines without daring to help the Jews in Khaybar. Then he suddenly turned toward Khaybar. The village's farmers, who had left their homes early with their farming tools, saw the Muslim army approach the city and began running and taking shelter in their formidable citadels.
The Messenger besieged Khaybar for 3 weeks. Toward the end of the siege, he gathered his soldiers and told them: "Tomorrow I will hand the standard to him who loves God and His Messenger and is loved by God and His Messenger. God will enable us to conquer Khaybar through him."  On the next day, almost everyone was hoping to receive the standard. However, the Messenger asked for 'Ali. Told that "he has sore eyes," the Messenger sent for him, applied his saliva to 'Ali's sore eyes, and gave him the standard.  'Ali went to the fortress and, after a fierce battle, Khaybar was conquered. Among the prisoners was Safiyya, a noble woman and daughter of Huyay ibn Akhtab, the Banu Nadir's chief. By marrying her, the Messenger established a relationship with the conquered people.
The Battle of Mu'ta. In the peaceful atmosphere brought about by the treaty of Hudaybiya, the Messenger sent letters to neighboring kings inviting them to the fold of Islam. King Shurahbil of Busra, a Christian Arab, killed the envoy (Harith ibn 'Umayr). This was an unforgivable breach of international custom and the prestige of Islam, and could not remain unanswered. The Messenger formed an army of 3,000 men, with Zayd ibn Haritha as commander, and said: "If something happens to Zayd, Ja'far ibn Abi Talib will assume the command. If Ja'far is martyred, 'Abd Allah ibn Rawaha will assume the command. In case something happens to 'Abd Allah, choose one among you as the commander."
When the Muslim army reached Mu'ta, it confronted a 100,000-man Byzantine army. Obviously it would be a fierce battle. Each Muslim would have to fight about 33 of the enemy. In the meantime, the Messenger was in the mosque, relating the fighting to those around him. Zayd took the standard. He thrust himself into the enemy ranks and was martyred. The standard passed to Ja'far ibn Abi Talib. He also rose up to Paradise. 'Abd Allah ibn Rawaha took the standard and was martyred. Now the standard was in the hands of one of the "swords of God,"  meaning Khalid ibn Walid, who would, from then on, be called "the Sword of God." 
When it was night, Khalid stationed the troops at the rear in the front rank, and changed the wings, positioning those on the right to the left and vice versa. Seeing new troops before them in the morning, the Byzantine army was demoralized. When night fell, the sides parted with each other and retreated. The Muslim army returned to Madina with only 12 losses. Although this was a victory for the Muslims, they were ashamed to meet the Messenger. However, he welcomed and consoled them: "You didn't flee. You retreated to join me, and will go against them later."
 Bukhari, "Maghazi," 38
 Bukhari, 5:77; Muslim, 4:1872.
 Bukhari, "Maghazi," 44.
 Ibn Hanbal, 5:299; Tabari, 3:110.