What legally ended slavery was the ratification of the 13th Amendment of the US Constitution. This took place in December, 1865.
Greg Biggs