but many of the St. Louis inhabitants refused. St. Louis was transferred to the French First Republic in 1800 (although all of the colonial lands continued to be administered by Spanish officials), then sold by the French to the U.S. in 1803 as part of the Louisiana Purchase. St. Louis became the capital of, and gateway to, the new territory. Shortly after the official transfer of authority was made, the Lewis and Clark Expedition was commissioned by President Thomas Jefferson. The expedition departed from St. Louis in May 1804 along the Missouri River to explore the vast territory. There were hopes of finding a water route to the Pacific Ocean, but the party had to go overland in the Upper West. They reached the Pacific Ocean via the Columbia River in summer 1805. They returned, reaching St. Louis on September 23, 1806. Both Lewis and Clark lived in St. Louis after the expedition. Many other explorers, settlers, and trappers (such as Ashley's Hundred) would later take a similar route to the West. 19th century The city elected its first municipal legislators (called trustees) in 1808. Steamboats first arrived in St. Louis in 1817, improving connections with New Orleans and eastern markets. Missouri was admitted as a state in 1821. St. Louis was incorporated as a city in 1822, and continued to develop largely due to its busy port and trade connections. Immigrants from Ireland and Germany arrived in St. Louis in significant numbers starting in the 1840s, and the population of St. Louis grew from less than 20,000 inhabitants in 1840, to 77,860 in 1850, to more than 160,000 by 1860. By the mid-1800s, St. Louis had a greater population than New Orleans. Settled by many Southerners in a slave state, the city was split in political sympathies and became polarized during the American Civil War. In 1861, 28 civilians were killed in a clash with Union troops. The war hurt St. Louis economically, due to the Union blockade of river traffic to the south on the Mississippi River. The St. Louis Arsenal constructed ironclads for the Union Navy. Slaves worked in many jobs on the waterfront as well as on the riverboats. Given the city's location close to the free state of Illinois and others, some slaves escaped to freedom. Others, especially women with children, sued in court in freedom suits, and several prominent local attorneys aided slaves in