Slavery in the United States existed as a legal institution from the early years of the colonial period; it was firmly established by the time the United States sought independence from Great Britain in 1776. However, by 1804, all states north of the Mason and Dixon Line had either abolished slavery outright or passed laws for the gradual abolition of slavery. In 1787 Congress prohibited slavery in the Northwest Territory, after a proposal by Thomas Jefferson to abolish it in all the territories failed by one vote. However slavery gained new life in the South with the cotton industry after 1800, and expanded into the Southwest. The nation was polarized into slave and free states along the Mason-Dixon Line, which separated Pennsylvania and Maryland. The international import or export of slaves became a crime under U.S. and British law in 1808. By the 1850s the South was vigorously defending slavery and its expansion into the territories. In the North a small number of abolitionists denounced it as sinful, and a large number of anti-slavery forces rejected it as detrimental to the rights of free men. Compromises were attempted and failed, and in 1861 eleven slave states broke away to form the Confederate States of America, leading to the American Civil War. The federal government in 1862 made abolition of slavery a war goal. In 1863 President Abraham Lincoln freed slaves in the rebellious southern states through the Emancipation Proclamation. The Thirteenth Amendment, taking effect in December 1865, permanently abolished slavery throughout the entire United States, including the Border states, such as Kentucky, which still had about 50,000 slaves, and the Indian tribes.