|Part of a series on|
Slavery in Afghanistan was present in the post-Classical history of Afghanistan, continued during the Middle Ages, and persisted into the 1920s.
The origin of the enslaved people in Afghanistan shifted during different periods, and slaves in Afghanistan never had any particular ethnicity. Slavery was formally abolished in 1923.
After the Islamic conquest of Persia, regions of both Persia and Afghanistan that had not converted to Islam were considered infidel regions, and as a result, they were considered legitimate targets of slave raids that were launched from regions whose populations had converted to Islam: for example Daylam in northwestern Iran and the mountainous region of Ḡūr in central Afghanistan were both exposed to slave raids which were launched from Muslim regions.
It was considered legitimate to enslave war captives; during the Afghan occupation of Persia (1722-1730), for example, thousands of people were enslaved, and the Baluch made regular incursions into Southeastern Iran for the purpose of capturing people and turning them into slaves. The slave traffic in Afghanistan was particularly active in the northwest, where 400 to 500 were sold annually. In Southern Iran, poor parents sold their children into slavery, and as late as around 1900, slave raids were conducted by chieftains in south Iran. The markets for these captives were often in Arabia and Afghanistan; “most of the slave girls employed as domestics in the houses of the gentry at Kandahar were brought from the outlying districts of Ghayn”.
The rulers of Afghanistan customarily had a harem of four official wives as well as a large number of unofficial wives for the sake of tribal marriage diplomacy, in addition to enslaved harem women known as kaniz (“slave girl”) and surati or surriyat ("mistress" or concubine)), guarded by the ghulam bacha (eunuchs).
Most slaves were employed as agricultural laborers, domestic slaves and sexual slaves, while other slaves served in administrative positions. Slaves in Afghanistan possessed some social mobility, especially those slaves who were owned by the government. Slavery was more common in towns and cities, because some Afghan tribal communities did not readily engage in the slave trade; according to some sources, the decentralized nature of Afghan tribes forced more urbanized areas to import slaves to fill labor shortages. Most slaves in Afghanistan had been imported from Persia and Central Asia.
According to a report of an expedition to Afghanistan published in London in 1871:
In response to the Hazara uprising of 1892, the Afghan Emir Abdur Rahman Khan declared a "Jihad" against the Shiites. His large army defeated the rebellion at its center, in Oruzgan, by 1892 and the local population was being massacred. According to S. A. Mousavi, "thousands of Hazara men, women, and children were sold as slaves in the markets of Kabul and Qandahar, while numerous towers of human heads were made from the defeated rebels as a warning to others who might challenge the rule of the Amir".     Segments of the Hazara people were still living in slavery and sold in the slave market of Kabul as late as in the early 20th-century.     
When Amanullah Khan banned slavery in the 1920s, many of the slaves at the time of the abolition were of Hazara origin.
By the time of the official abolition of slavery in 1923, there were about 700 enslaved people in Kabul, called begar or impressed labor. Slaves under the age of twelve were sold for a price of 50 rupees and slaves over twelve cost 30 rupees; most wealthy families had at least one or two slaves, and it was common to exchange them as gifts. Male slaves were often referred to as ghulam, and female as either kaniz (domestic maidservants) or surriyat (referring to concubines).
Amanullah Khan banned slavery in Afghanistan in the 1923 Constitution, but the practice carried on unofficially for many more years. The Swede Aurora Nilsson, who lived in Kabul in 1926–1927, described the occurrence of slavery in Kabul in her memoirs, as well as how a German woman, the widow of an Afridi man named Abdullah Khan, who had fled to the city with her children from her late husband's successor, was sold at public auction and obtained her freedom by being bought by the German diplomatic mission for 7,000 marks.
In Afghanistan, one of the atrocities committed by the Taliban was the enslavement of the Afghan women for use as concubines. In 1998, eyewitnesses in Mazar e Sharif reported the hundreds of Shia girls had been abducted by Taliban fighters. One source suggests that up to 400 Afghan women were involved.