linguistic:paraphrasing, quality:correction
Founding

Nine cities served as capitals to the Continental Congress and under the Articles of Confederation. New York City was the first capital upon the adoption of the Constitution, succeeded by Philadelphia, which was capital from 1790 to 1800.

On October 6, 1783, after the capital was forced by the Pennsylvania Mutiny of 1783 to move to Princeton, Congress resolved to consider a new location for it. The following day, Elbridge Gerry of Massachusetts moved "that buildings for the use of Congress be erected on the banks of the Delaware near Trenton, or of the Potomac, near Georgetown, provided a suitable district can be procured on one of the rivers as aforesaid, for a federal town".

In Federalist No. 43, published January 23, 1788, James Madison argued that the new federal government would need authority over a national capital to provide for its own maintenance and safety. The Pennsylvania Mutiny of 1783 emphasized the need for the national government not to rely on any state for its own security.

Article One, Section Eight of the Constitution permits the establishment of 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". However, the constitution does not specify a location for the capital. In the Compromise of 1790, Madison, Alexander Hamilton, and Thomas Jefferson agreed that the federal government would pay each state's remaining Revolutionary War debts in exchange for establishing the new national capital in the Southern United States.

On July 9, 1790, Congress passed the Residence Act, which approved the creation of a national capital on the Potomac River. Under the Residence Act, the exact location was to be selected by President George Washington, who signed the bill into law on July 16, 1790. Formed from land donated by Maryland and Virginia, the initial shape of the federal district was a square measuring 10 miles (16 km) on each side and totaling 100 square miles (259 km).

Two pre-existing settlements were included in the territory, the port of Georgetown, founded in 1751, and the port city of Alexandria, Virginia, founded in 1749. In 1791 and 1792, a team led by Andrew Ellicott, including Ellicott's brothers Joseph and Benjamin and African American astronomer Benjamin Banneker, whose parents had been enslaved, surveyed the borders of the federal district and placed boundary stones at every mile point; many of these stones are still standing. Both Maryland and Virginia were slave states, and slavery existed in the District from its founding. The building of Washington likely relied in significant part on slave labor, and slave receipts have been found for the White House, Capitol Building, and establishment of Georgetown University. The city became an important slave market and a center of the nation's internal slave trade.

After its survey, the new federal city was constructed on the north bank of the Potomac River, to the east of Georgetown centered on Capitol Hill. On September 9, 1791, three commissioners overseeing the capital's construction named the city in honor of President Washington. The same day, the federal district was named Columbia, a feminine form of Columbus, which was a poetic name for the United States commonly used at that time. Congress held its first session there on November 17, 1800.

Congress passed the District of Columbia Organic Act of 1801, which officially organized the district and placed the entire territory under the exclusive control of the federal government. The area within the district was organized into two counties, the County of Washington to the east and north of the Potomac and the County of Alexandria to the west and south. After the Act's passage, citizens in the district were no longer considered residents of Maryland or Virginia, which ended their representation in Congress.