Slavery in what became the U.S. state of Illinois existed for more than a century. Illinois did not become a state until 1818, but earlier regional systems of government had already established slavery. France introduced African slavery to the Illinois Country in the early eighteenth century. French and other inhabitants of Illinois continued the practice of owning slaves throughout the Illinois Country's period of British rule (1763–1783), as well as after its transfer to the new United States in 1783 as Illinois County, Virginia. The Northwest Ordinance (1787) banned slavery in Illinois and the rest of the Northwest Territory. Nonetheless, slavery remained a contentious issue, through the period when Illinois was part of the Indiana Territory and the Illinois Territory and some slaves remained in bondage after statehood until their gradual emancipation by the Illinois Supreme Court. Thus the history of slavery in Illinois covers several sometimes overlapping periods: French (c. 1660s–1764); British (c. 1763–1783); Virginia (c. 1778–1785); United States Northwest Territory (1787–1800), Indiana Territory (1800–1809), Illinois Territory (1809–1818) and the State of Illinois (after 1818).
The geography of the state meant that its southern tip extended into the Upper South and was surrounded by territories that would eventually become the slave states of Kentucky and Missouri, meaning that southern Illinois would be more pro-slavery than the north of the state. When Illinois became a state, its constitution forbade the expansion of slavery, but allowed its existence under certain conditions, such as keeping already existing slavery (which was primarily in the south) intact, and tolerated brief visits from out-of-state slaves and their masters. Nevertheless, during the early decades of statehood, the number of slaves in Illinois dwindled, as the Illinois Supreme Court largely ruled against maintaining legacy slavery.
In the decade just before the American Civil War, an anti-Black law was adopted in the state, which made it difficult for new Black emigrants to enter or live in Illinois. This law led to organizing among the relatively small community of free blacks in Illinois and the state's first convention for black civil rights. Near the close of the civil war, Illinois repealed the anti-Black law and became the first state to ratify the Thirteenth Amendment to the Constitution of the United States, which abolished slavery nationally.