The sack of Shamakhi took place on 18 August 1721, when rebellious Sunni Lezgins, within the declining Safavid Empire, attacked the capital of Shirvan province, Shamakhi (in present-day Azerbaijan Republic). The initially successful counter-campaign was abandoned by the central government at a critical moment and with the threat then left unchecked, Shamakhi was taken by 15,000 Lezgin tribesmen, its Shia population massacred, and the city ransacked.
The deaths of Russian merchants within Shamakhi were subsequently used as a casus belli for the Russo-Persian War of 1722–1723, leading to the cessation of trade between Iran and Russia and the designation of Astrakhan as the new terminus on the Volga trade route.
Background
By the first decade of the 18th century, the once-prosperous Safavid realm was in a state of heavy decline, with insurrections in numerous parts of its domains. The king, Soltan Hoseyn, was a weak ruler, and although personally inclined to be more humane, flexible, and relaxed than his chief mullah, he went along with the recommendations of his advisers regarding important state decisions. He reigned as a "stationary monarch", preferring, apart from the occasional hunting party, to be inside or near the capital of Isfahan at all times, invisible to all "but the most intimate of courtiers". Having seen not much more of the world than the harem walls, he had quickly fallen under the spell of the leading ulama, most notably Mohammad-Baqer Majlesi. Majlesi, who had already gained considerable political power during the reign of Soltan Hoseyn's predecessor SuleimanI ( 1666–1694), instigated the persecutions directed towards Safavid Iran's Sunni and Sufi inhabitants, as well as its non-Muslim religious minorities, namely Christians, Jews, and Zoroastrians. Though the Christians, mainly represented by the Armenians, suffered less than other groups, they were also targeted from time to time. According to historian Roger Savory, even though Soltan Hoseyn did not show personal hostility towards Christians, he was persuaded by the clergy (Majlisi in particular), who had great influence over him, to issue "unjust and intolerant decrees". The tense religious atmosphere in the late Safavid era would prove to be a significant factor in the revolts by Sunni adherents from various places within the empire. As the historian Michael Axworthy notes: "The clearest example was the revolt in Shirvan, where Sunni religious men had been killed, religious books destroyed and Sunni mosques turned into stables".
The Sunni population in the northwestern domains of the Safavids, comprising Shirvan and Daghestan, felt the burden of the Shia persecution during Soltan Hoseyn's reign. 1718 saw an intensification of the Lezgin incursions into Shirvan, rumoured, according to historian Rudi Matthee, to have been incited by then grand vizier Fath-Ali Khan Daghestani (1716–1720). Russia's ambassador to Safavid Iran, Artemy Volynsky, who was in Shamakhi in 1718, reported that, because local officials considered the grand vizier "an infidel", they considered his orders invalid and even questioned the king's authority. Florio Beneveni, an Italian in the Russian diplomatic service, insisted that Shamakhi's inhabitants were ready to revolt against the government for "extorting large sums of money from them". The marauding raids, incursions, and pillages nevertheless carried on; in April of the same year, the Lezgins took the village of AkTashi (located near Nizovoi), but not before abducting a number of its inhabitants and plundering a caravan of 40people on the road to Shamakhi. After these events, numerous additional reports in relation to the rebels are reported.