Some enslaved Africans bought their freedom from their owners after working for a certain number of years. However, this method became less frequent as the 19th century progressed.
Even so, many African-Americans were able to obtain their freedom and live in a status of semi-freedom even before slavery was prohibited.