The Battle of Samarkand was a military engagement between the Umayyads and the Sogdian ruler of Samarkand. The battle ended in Umayyad victory and the conquest of Samarkand.
After the Umayyad conquest of Bukhara in 709, the Umayyad general Qutayba ibn Muslim dispatched his brother, Abdul Rahman to Samarkand. The Sogdian ruler of Samarkand, Tarkhun, gave tribute to them, which was agreed between them previously. Tarkhun would make peace with the Umayyads in exchange for not invading them. The merchants and nobles of Samarkand hated Tarkhun for his weakness and his tribute payment. They planned on deposing and chose a man called Gurak. Tarkhun was deposed and later committed suicide. The death of Tarkhun provoked the Umayyads to take revenge for his death. The Umayyads first had to deal with Zunbil of Sistan in 711 and the rebellion of Azkajwar II brother in 712.
After some rest, the Umayyads marched to Samarkan in 712. Samarkand was the largest and most powerful city in Sogdia, and it's effective capital. Qutayba and his brother, Abdul Rahman, marched to Samarkand with an army of 20,000 men. It is said to consist of men from Bukhara and Khawarizm. The Samarkand ruler, Gurak, was determined to put up stiff resistance. He also appealed to other rulers in Transoxianan, mainly the king of Tashkent and the Ikhshid of Farghana, and warned them that Transoxinia would be in danger if they did not help. Both answered his call. They arrived with a large army.
Kul Tegin was dispatched to lead The Tashkent-Farghan army. The Turks attempted a surprise attack on the Muslims during the night; however, Qutayba learned of their plans and dispatched his brother, Salih, with a small force and ambushed them. The battle at night was fierce; following numerous engagements and prolonged blockade, the Transoxinian alliance were ultimately defeated. Many were killed, and a small number of prisoners were taken. Gurak surrendered and was captured by the Umayyads. The Muslims also acquired a large number of weapons and horses. Qutayba allowed the small force to keep their spoils instead of dividing them with the whole army.
The defeat of the Transoxinian army discouraged the Sogdians of Samarkand. Qutayba was constantly bombarding the city. This created a breach in the walls, and the time the Muslims were about to assault them, the Samakands sued for peace. After Gurak's surrender, Qutayba decided not to execute Gurak, and they later came in terms. the Umayyads established a garrison in Samarkand, Which Qutayba used as a strategic base for subsequent campaigns against Shash, Khojent, and Ferghana.
Qutayba garrisoned Samarkand with 4,000 men led by his brother Abdulrahman. Gurak remained the king of Sogdia, but his new capital was Ishtixon. The city became a Muslim-only stronghold. Qutabya then removed the fire temples and built a mosque in the city. He also ordered the idols in Samarkand to be destroyed. Non-Muslims were allowed to enter if they had permits in the form of clay seals on their hands.
The conquest of Samarkand was a major victory for the Muslims. Qutayba marched further into Sogdia in 713 and began imposing levies on the rest of the territory. Umayyad troops were now coming closer to the borders of Tang dynasty, and both the Arabs and the Sogdians began to send envoys to try to win Chinese support.