Battle of Badr In 622, Muhammad bade many of his followers to migrate from Mecca to the neighboring city of Medina, 320 km (200 mi) north of Mecca. Shortly thereafter, Muhammad himself left for Medina. This migration is referred to as the "Hijra". The Quranic Verse 22:39 uttered by Muhammad sometime shortly after the migration permitted Muslims, for the first time, to take up arms in defence. During this period Muhammad employed three broad military strategies against the Meccans. Firstly, to establish peace treaties with the tribes surrounding Medina, especially with those from whom the Meccans could derive most advantage against the Muslims.
Battle of the Defile the Turgesh army withdrew north towards Samarkand. The Muslim army followed, and scored a victory in a battle fought near the city. Junayd then retired with his troops to winter in Merv. During the winter, rebellions broke out south of the Oxus, in Tokharistan, which had hitherto been quiescent to Muslim rule. Junayd was forced to set out for Balkh and there dispersed 28,000 of his men to quell the revolt. This left him seriously weakened when, in early 731, the Turgesh laid siege to Samarkand and appeals for aid arrived from the city's governor, Sawra ibn al-Hurr al-Abani. Despite