score:8
On the 27th of January 1416, the Republic of Ragusa (Dubrovnik) banned the slave trade. At a meeting of the Grand Chamber of the Republic of Dubrovnik on the 27th of January 1416 a total of 75 councillors of 78 in the council voted to ban slavery in the Republic. The very next day the vote and the decision came into effect and slavery was banned. Dubrovnik the city state had never participated in the slave trade, but this decision went further.
The decision stated that "none of our nationals or foreigners, and everyone who considers himself or herself from Dubrovnik, can in any way or under any pretext to buy or sell slaves or female servant or be a mediator in such trade.” With this decision the Republic of Dubrovnik was among the first countries in Europe and in the world to ban the buying and selling of slaves.
For example Great Britain banned the trading of slaves 391 years later, and the USA banned the slave trade 450 years after Dubrovnik on the 18th of December 1865.
Freedom From Slavery Came Early in an Unexpected Country. https://www.huffingtonpost.com/regina-fraser-and-pat-johnson/freedom-from-slavery-croatia_b_4905880.html
More about Dubrovnik.. By the Republic of Raguso (Dubrovnik), it was the first country to recognize the young United States. The Republic of Dubrovnik ended in 1806 when Dubrovnik was surrendered to Napoleon. Today Dubrovnik is a UNESCO world heritage site, and the setting for multiple cities in the HBO series "Game of Thrones", including Kings Landing, Quarth, Battle of the Blackwater, and Dorn.
Upvote:10
It seems that the bannishment of slavery in France predates the ruling in Ragusa in the other answer by a century.
Quoting @T.E.D.'s answer in a different question :
King Louis X in 1315 declared that "France signifies freedom", and ordered all slaves and serfs setting foot on French soil to be freed. It seems to be assumed that this was in a large part a financial move (the serfs were supposed to pay the crown for their freedom), but the principle was applied to foreign slaves imported into France thereafter, to no financial benefit to the crown.
Another incentive might have been to legitimize the (then finishing and victorious) fight of the crown against the Order of Solomon's Temple, whose knights had often brought back slaves from the last crusades.
Sure, that ruling will not stop France from actively enforcing slavery oversees when it built its colonial empire(s) centuries later. However, I am not aware of the existence of any slaves on mainland France after the 14th century. Though Wikipedia points that
some limited cases of slavery continued until the 17th century in some of France's Mediterranean harbours in Provence.
Upvote:14
Seems like the other answers are late by at least a thousand years - China did it around the beginning of the common era. From Wikipedia:
In the year AD 9, the Emperor Wang Mang usurped the Chinese throne and instituted a series of sweeping reforms, including the abolition of slavery and radical land reform. Slavery was reinstated in AD 12 before his assassination in AD 23.
In that same wikipedia article, another prominent example is that during the Ming Dynasty:
The Hongwu Emperor sought to abolish all forms of slavery but in practice, slavery continued through the Ming dynasty.
So it seems that there were at least some enlightened rulers, but they were not 100% effective (much like modern times, [1]).
Another place to look is this WIkiepedia article where they speak about it happening in Greece in about 600 BC. But it seems slavery was only banned for Greeks, and they still had Barbarian slaves.
[1] I'd ask readers to note that slavery is illegal in the United States and much of the world today, yet it still exists in different forms.