In a fatwa by Dr. Hatem al-Haj of the Assembly of Muslim Jurists of America, we see:
Islam restricted the tributaries of slavery and widened the out channels, which ultimately depleted the entire river of slavery.
The idea is that: (a) through various means, Islam slowly eliminated slavery, and (b) in the interim, slaves were still recognized, but were to be treated well. IslamWeb enumerates some of these means, and says "Islam is the freer of slaves".
A Dar Al-Ifta fatwa gives a similar description, and writes:
Slavery ended worldwide after the international treaty for the abolishment of slavery was signed in Berlin in 1860 AD. This has become a binding system that disallows anyone to enslave another. ... Based on the above, slavery is impermissible in the Shari'ah.
I want to get an approximation for when slavery was considered abolished. Hence...
Question: In mainstream Sunni Islam, when was the last time a slave was legally recognized?
I choose to stick to Sunni Islam for this question, since it's possible other denominations recognized a slave, but that is disputed/unrecognized in Sunni Islam. I also want to stick to mainstream views because there's always going to be rogue scholars.
One possible example are the mamluks, but these are a bit different to an ordinary slave.