Slavery in the ancient world, from the earliest known recorded evidence in Sumeria to the pre-medieval Antiquity Mediterranean cultures, comprised a mixture of debt-slavery, slavery as a punishment for crime, and the enslavement of prisoners of war.
Masters could free slaves, and in many cases such freedmen went on to rise to positions of power. This would include those children born into slavery but who were actually the children of the master of the house. Their father would ensure that his children were not condemned to a life of slavery.
The institution of slavery condemned a majority of slaves to agricultural and industrial labor and they lived hard lives. In many of these cultures slaves formed a very large part of the economy, and in particular the Roman Empire and some of the Greek City-States built a large part of their wealth on slaves acquired through conquest.
The Sumerian Code of Ur-Nammu includes laws relating to slaves, written circa 2100 – 2050 BCE; it is the oldest known tablet containing a law code surviving today. The Babylonian Code of Hammurabi, dating to c. 1700 BCE, also makes distinctions between the freeborn, freed and slave.
Hittite texts from Anatolia include laws regulating the institution of slavery. Of particular interest is a law stipulating that reward for the capture of an escaped slave would be higher if the slave had already succeeded in crossing the Halys River and getting farther away from the center of Hittite civilization — from which it can be concluded that at least some of the slaves kept by the Hittites possessed a realistic chance of escaping and regaining their freedom, possibly by finding refuge with other kingdoms or ethnic groups.
In Ancient Egypt, slaves were mainly obtained through prisoners of war. Other ways people could become slaves was by inheriting the status from their parents. One could also become a slave on account of his inability to pay his debts. Slavery was the direct result of poverty. People also sold themselves into slavery because they were poor peasants and needed food and shelter. The lives of slaves were normally better than that of peasants. Slaves only attempted escape when their treatment was unusually harsh. For many, being a slave in Egypt made them better off than a freeman elsewhere. Young slaves could not be put to hard work, and had to be brought up by the mistress of the household. Not all slaves went to houses. Some also sold themselves to temples, or were assigned to temples by the king. Slave trading was not very popular until later in Ancient Egypt. Afterwards, slave trades sprang up all over Egypt. However, there was barely any worldwide trade. Rather, the individual dealers seem to have approached their customers personally. Only slaves with special traits were traded worldwide. Prices of slaves changed with time. Slaves with a special skill were more valuable than those without one. Slaves had plenty of jobs that they could be assigned to. Some had domestic jobs, like taking care of children, cooking, brewing, or cleaning. Some were gardeners or field hands in stables. They could be craftsmen or even get a higher status. For example, if they could write, they could become a manager of the master's estate. Captive slaves were mostly assigned to the temples or a king, and they had to do manual labor. The worst thing that could happen to a slave was being assigned to the quarries and mines. Private ownership of slaves, captured in war and given by the king to their captor, certainly occurred at the beginning of the Eighteenth Dynasty (1550–1295 BCE). Sales of slaves occurred in the Twenty-fifth Dynasty (732–656 BCE), and contracts of servitude survive from the Twenty-sixth Dynasty (c. 672 – 525 BCE) and from the reign of Darius: apparently such a contract then required the consent of the slave.