

The Baltimore and Ohio Railroad, the oldest railroad in the United States, was built in 1830 and cemented Baltimore's status as a major transportation hub, giving producers in the Midwest and Appalachia access to the city's port. During the Pratt Street Riot of 1861, the city was the site of some of the earliest violence associated with the American Civil War. The Battle of Baltimore was a pivotal engagement during the War of 1812, culminating in the failed British bombardment of Fort McHenry, during which Francis Scott Key wrote a poem that would become " The Star-Spangled Banner", which was eventually designated as the American national anthem in 1931.

The first printing press and newspapers were introduced to Baltimore by Nicholas Hasselbach and William Goddard respectively, in the mid 18th century. Colonists from the Province of Maryland established the Port of Baltimore in 1706 to support the tobacco trade with Europe, and established the Town of Baltimore in 1729.

Prior to European colonization, the Baltimore region was used as hunting grounds by the Susquehannock Native Americans, who were primarily settled further north than where the city was later built. Baltimore is located about 40 miles (64 km) northeast of Washington, D.C., making it a principal city in the Washington–Baltimore combined statistical area (CSA), the third-largest CSA in the nation, with a calculated 2018 population of 9,797,063. As of 2017, the population of the Baltimore metropolitan area was estimated to be just under 2.802 million, making it the 21st largest metropolitan area in the country. Baltimore was designated an independent city by the Constitution of Maryland in 1851, and today is the largest independent city in the United States. state of Maryland, as well as the 30th most populous city in the United States, with a population of 585,708 in 2020.
