The Battle of Uhud was fought on 23 March, 625 (3 Shawwal 3 AH in the Islamic calendar) at Mount Uhud, in what is now north-western Arabia. It occurred between a force from the Muslim community of Medina led by Muhammad, and a force led by Abu Sufyan from Mecca, the town from which many of the Muslims had previously emigrated (hijra). The Battle of Uhud was the second military encounter between the Meccans and the Muslims, preceded by the Battle of Badr in 624, where a small Muslim army had defeated the larger Meccan army. Marching out from Mecca towards Medina on 11 March, 625, the Meccans desired to avenge their losses at Badr and strike back at Muhammad. The Muslims readied for war soon afterwards and the two armies fought on the slopes and plains of Uhud. Whilst heavily outnumbered, the Muslims gained the early initiative and forced the Meccan lines back, thus leaving much of the Meccan camp unprotected. As the Muslims left their assigned posts to despoil the Meccan camp, a surprise attack from the Meccan cavalry brought chaos to the Muslim ranks. Many Muslims were killed, and they withdrew up the slopes of Uhud. The Meccans did not pursue the Muslims further, but marched back to Mecca declaring victory. For the Muslims, the battle was a significant setback: although they had been close to routing the Meccans a second time, their desire for the Meccan spoils reaped severe consequences. The two armies would meet again in 627, at the Battle of the Trench.