I believe that it was the Emancipation Proclamation that freed all of the slaves. And the thirteenth amendment officially banned all forms of slavery. The fifteenth amendment then gave all people (men of different colors. Still no women) the right of citizenship.
I hope this helped