An Algonquian people known as the Nacotchtank inhabited the area around the Anacostia River in present-day Washington when the first Europeans arrived in the 17th century; however, Native American people had largely relocated from the area by the early 18th century. Georgetown was chartered by the Province of Maryland on the north bank of the Potomac River in 1751. The town would be included within the new federal territory established nearly 40 years later. The City of Alexandria, Virginia, founded in 1749, was also originally included within the District. James Madison explained the need for a federal district on January 23, 1788 in the Federalist No. 43, arguing that the national capital needed to be distinct from the states, in order to provide for its own maintenance and safety. An attack on the Congress at Philadelphia by a mob of angry soldiers, known as the Pennsylvania Mutiny of 1783, had emphasized the need for the government to see to its own security. Therefore, the authority to establish a federal capital was provided in Article One, Section Eight, of the United States Constitution, which permits a "District (not exceeding ten miles square) as may, by cession of particular states, and the acceptance of Congress, become the seat of the government of the United States".
The Constitution, however, does not specify a location for the new capital. In what later became known as the Compromise of 1790, Madison, Alexander Hamilton, and Thomas Jefferson came to an agreement that the federal government would assume war debt carried by the states, on the condition that the new national capital would be located in the South. View of the United States Capitol before the Burning of Washington (circa 1800)On July 16, 1790, the Residence Act provided for a new permanent capital to be located on the Potomac River, the exact area to be selected by President Washington. As permitted by the U.S. Constitution, the initial shape of the federal district was a square, measuring 10 miles (16 km) on each side, totaling 100 square miles (260 km2). During 1791–92, Andrew Ellicott and several assistants, including Benjamin Banneker, surveyed the border of the District with both Maryland and Virginia, placing boundary stones at every mile point; many of the stones are still standing. A new "federal city" was then constructed on the north bank of the Potomac, to the east of the established settlement at Georgetown. On September 9, 1791, the federal city was named in honor of George Washington and the district was named the Territory of Columbia, Columbia being a poetic name for the United States in use at that time. Congress held its first session in Washington on November 17, 1800. The Organic Act of 1801 officially organized the District of Columbia and placed the entire federal territory, including the cities of Washington, Georgetown, and Alexandria under the exclusive control of Congress. Further, the unincorporated territory within the District was organized into two counties: the County of Washington on the north bank of the Potomac, and the County of Alexandria on the south bank.
Following this Act, citizens located in the District were no longer considered residents of Maryland or Virginia, thus ending their representation in Congress. Ford's Theatre in the 19th century, site of the 1865 assassination of President LincolnOn August 24–25, 1814, in a raid known as the Burning of Washington, British forces invaded the capital during the War of 1812, in retaliation for the sacking and burning of York (modern-day Toronto). The Capitol, Treasury, and White House were burned and gutted during the attack. Most government buildings were quickly repaired, but the Capitol, which was at the time largely under construction, would not be completed until 1868. During the 1830s, the District's southern county of Alexandria went into economic decline, due in part to heavy competition with the port of Georgetown, which was further inland and on the C&O Canal. At the time, Alexandria was a major market in the American slave trade, but rumors circulated that abolitionists were attempting to end slavery in the nation's capital. Partly to avoid an end to the lucrative slave trade, a referendum to ask for the retrocession of Alexandria passed in 1846. On July 9 of that year, Congress agreed to return all the District's territory south of the Potomac River back to the Commonwealth of Virginia. Four years later, the Compromise of 1850 outlawed the slave trade in the District, though not slavery itself. Washington remained a small city until the outbreak of the American Civil War in 1861.
The significant expansion of the federal government as a result of the war led to notable growth in the city's population, as did a large influx of freed slaves. By 1870, the District's population had grown to nearly 132,000. Despite the city's growth, Washington still had dirt roads and lacked basic sanitation; the situation was so bad that some members of Congress proposed moving the capital elsewhere. Crowds surrounding the Reflecting Pool, during the 1963 March on WashingtonWith the Organic Act of 1871, Congress created a new government for the entire federal territory. This Act effectively combined the City of Washington, Georgetown, and Washington County into a single municipality officially named the District of Columbia. Even though the City of Washington legally ceased to exist after 1871, the name continued in use and the whole city became commonly known as Washington, D.C. In the same Organic Act, Congress also appointed a Board of Public Works charged with modernizing the city. In 1873, President Grant appointed the board's most influential member, Alexander Shepherd, to the new post of governor. That year, Shepherd spent $20 million on public works ($357 million in 2007), which modernized Washington but also bankrupted the city.
In 1874, Congress abolished Shepherd's office in favor of direct rule. Additional projects to renovate the city would not be executed until the McMillan Plan in 1901. The District's population remained relatively stable until the Great Depression in the 1930s when President Franklin D. Roosevelt's New Deal legislation expanded the bureaucracy in Washington. World War II further increased government activity, adding to the number of federal employees in the capital; by 1950, the District's population reached a peak of 802,178 residents. The Twenty-third Amendment to the United States Constitution was ratified in 1961 and grants the District three votes in the Electoral College. After the assassination of civil rights leader Martin Luther King, Jr. on April 4, 1968, riots broke out in the District, primarily in the U Street, 14th Street, 7th Street, and H Street corridors. The riots raged for three days until over 13,000 federal and national guard troops managed to quell the violence. Many stores and other buildings were burned; most remained in ruins and were not rebuilt until the late 1990s. In 1973, Congress enacted the District of Columbia Home Rule Act, providing for an elected mayor and city council for the District. In 1975, Walter Washington became the first elected and first black mayor of the District. However, during successive administrations, the city was criticized for mismanagement and waste. In 1995, Congress created the District of Columbia Financial Control Board to oversee all municipal spending and rehabilitate the city government. The District regained control over its finances in September 2001 and the oversight board's operations were suspended. On September 11, 2001, terrorists hijacked American Airlines Flight 77 and deliberately crashed the plane into The Pentagon in nearby Arlington, Virginia, while United Airlines Flight 93 was destined for Washington, D.C., but crashed in Pennsylvania.