As early as the seventh century, Saint Bathilde (wife of King Clovis II) became famous for her campaign to stop slave-trading and free all slaves; in 851 Saint Anskar began his efforts to halt the Viking slave trade. That the Church willingly baptized slaves was claimed as proof that they had souls, and soon both kings and bishops—including William the Conqueror (1027-1087) and Saints Wulfstan (1009-1095) and Anselm (1033-1109)—forbade the enslavement of Christians.
Since, except for small settlements of Jews, and the Vikings in the north, everyone was at least nominally a Christian, that effectively abolished slavery in medieval Europe, except at the southern and eastern interfaces with Islam where both sides enslaved one another's prisoners. But even this was sometimes condemned: in the tenth century, bishops in Venice did public penance for past involvement in the Moorish slave trade and sought to prevent all Venetians from involvement in slavery. Then, in the thirteenth century, Saint Thomas Aquinas deduced that slavery was a sin, and a series of popes upheld his position, beginning in 1435 and culminating in three major pronouncements against slavery by Pope Paul III in 1537.
It is significant that in Aquinas's day, slavery was a thing of the past or of distant lands. Consequently, he gave very little attention to the subject per se, paying more attention to serfdom, which he held to be repugnant.
However, in his overall analysis of morality in human relationships, Aquinas placed slavery in opposition to natural law, deducing that all "rational creatures" are entitled to justice. Hence he found no natural basis for the enslavement of one person rather than another, "thus removing any possible justification for slavery based on race or religion." Right reason, not coercion, is the moral basis of authority, for "one man is not by nature ordained to another as an end."
Here Aquinas distinguished two forms of "subjection" or authority, just and unjust. The former exists when leaders work for the advantage and benefit of their subjects. The unjust form of subjection "is that of slavery, in which the ruler manages the subject for his own [the ruler's] advantage." Based on the immense authority vested in Aquinas by the Church, the official view came to be that slavery is sinful.
It is true that some popes did not observe the moral obligation to oppose slavery—indeed, in 1488 Pope Innocent VIII accepted a gift of a hundred Moorish slaves from King Ferdinand of Aragon, giving some of them to his favorite cardinals. Of course, Innocent was anything but that when it came to a whole list of immoral actions. However, laxity must not be confused with doctrine. Thus while Innocent fathered many children, he did not retract the official doctrine that the clergy should be celibate. In similar fashion, his acceptance of a gift of slaves should not be confused with official Church teachings. These were enunciated often and explicitly as they became pertinent.