to gain a semblance of freedom during the American Civil War; the Confiscation Act of 1861 allowed fugitive slaves who escaped to behind Union lines to remain free, as the military declared them part of "contraband" from the war and refused to return them to slaveholders; the Confiscation Act of 1862 guaranteed both fugitive slaves and their families everlasting freedom, and the Militia Act allowed black men to enroll in military service. In January 1863, Lincoln's Emancipation Proclamation freed the enslaved in Confederate-held territory only. Black men were officially admitted to serve in the Union Army and the United States Colored Troops were organized. Black participation in fighting proved essential to Union victory. In 1865, the Union won the Civil War, and states ratified the Thirteenth Amendment, outlawing slavery (except as punishment for a crime) throughout the entire country. The Southern states initially enacted Black Codes in an attempt to maintain control over black labor. The Mississippi Black Code (the first to pass and the best known) distinguished between "free negroes" (referring to those who had been free before the war, in some places called "Old Issues"), (newly free) "freedmen", and "mulattoes" — though placing similar restrictions on freedom for all. US-born blacks gained legal citizenship with the Civil Rights Act of 1866, followed by the Fourteenth Amendment Citizenship Clause. Regional differences Migration to cities The lives of free blacks varied depending on their location within the United States. There was a significant free-black bias towards cities, as many rural free blacks migrated to cities over time, both in the North and the South. Cities were the chief destinations for migrating free blacks in the South, as cities gave free blacks a wider range of economic and social opportunities. Most southern cities had independently black-run churches as well as secret schools for educational advancement. Northern cities also gave blacks better opportunities. For example, free Negroes who lived in Boston generally had more access to formal education. In the South Before the American Revolution, there were very few free blacks in the Southern colonies. The Lower South, except for its cities, did not attract many free blacks. The number of urban free Negroes grew faster than the total free black population, and this growth largely came from a mass migration of rural free Negroes moving to cities, such as Richmond and Petersburg of Virginia, Raleigh and Wilmington of North Carolina, Charleston