The history of slavery spans many cultures, nationalities, and religions from ancient times to the present day. Likewise, its victims have come from many different ethnicities and religious groups. The social, economic, and legal positions of slaves have differed vastly in different systems of slavery in different times and places.
Slavery has been found in some hunter-gatherer populations, particularly as hereditary slavery, but the conditions of agriculture with increasing social and economic complexity offer greater opportunity for mass chattel slavery. Slavery was institutionalized by the time the first civilizations emerged (such as Sumer in Mesopotamia, which dates back as far as 3500 BC). Slavery features in the Mesopotamian Code of Hammurabi (c. 1750 BC), which refers to it as an established institution.
Slavery was widespread in the ancient world in Europe, Asia, the Middle East, and Africa.
It became less common throughout Europe during the Early Middle Ages, although it continued to be practised in some areas. Both Christians and Muslims captured and enslaved each other during centuries of warfare in the Mediterranean and Europe.