In the early nineteenth century, Maryland grew economically, as ships built in Maryland increasingly conducted international commerce, supplying European nations embroiled in the Napoleonic Wars with supplies. After the British were defeated in the War of 1812, Maryland expanded economically with railroads, public roads, and canals. Agriculture, however, continued to be an important element of the state's economy, with African slaves providing the labor on plantations.
There were, according to the U.S. Census of 1860 (the last census before the Civil War), 87,189 slaves, 83,942 free colored persons, and 515,918 whites in Maryland. When the Civil War began, troops from the North passed through Maryland to protect Washington, D.C., from Southern forces. However, on April 19, 1861, a mob from Baltimore attacked these troops, and Northern troops subsequently occupied Maryland during the remainder of the Civil War in order to ensure its allegiance to the Union. In fact, however, Marylanders fought on both sides of the War, and the battles of Monocacy, Sharpsburg (or Antietam), and South Mountain were fought in Maryland. In the post-Civil War years, Maryland grew rapidly and experienced significant urban and industrial expansion. As a result, the state became increasingly Northern in character.


















