In Ramadan 2 AH, about 313 Muslims met an army of around a thousand from Quraysh at Badr. Allah granted them a decisive victory: "Allah had already given you victory at Badr when you were weak" (3:123). Abu Jahl was among the leaders of Quraysh killed.
In 3 AH Quraysh returned to avenge Badr at Uhud. The Muslims were winning until most of the archers left their post on the hill, against the Prophet’s ﷺ instruction, and the enemy cavalry attacked from behind. Seventy Muslims were martyred, including Hamzah, and the Prophet ﷺ was wounded. The Quran draws lessons from the day (3:152–155).
In 5 AH a great alliance of tribes besieged Madinah. On the advice of Salman al-Farisi, the Muslims dug a trench across the open northern approach. After weeks of siege, cold and hunger, a fierce wind scattered the confederates (33:9–27).
In 6 AH the Prophet ﷺ set out with about 1,400 companions to perform Umrah but was stopped at al-Hudaybiyyah. He agreed a ten-year truce whose terms seemed hard to many Muslims, including returning that year without Umrah. Yet Allah called it "a clear victory" (48:1): in the peace that followed, more people entered Islam than ever before. He then sent letters inviting rulers, including the Byzantine emperor Heraclius, to Islam.
In 7 AH the Muslims took the fortified oasis of Khaybar, from where attacks on Madinah had been organised.