In the United States the Black Codes were laws passed by democrat-controlled Southern states in 1865-1866 after the Civil War. These laws kept African Americans from having rights, and also compelling them to work in a labor economy based on low wages or depth black codes were part of a larger pattern of southern whites trying to suppress the new freedom of emancipated African American slaves.