After adopting the Articles of Confederation, the Congress of the Confederation was formed and convened in Philadelphia from March 1781 until June 1783, when a mob of angry soldiers converged upon Independence Hall, demanding payment for their service during the American Revolutionary War. Congress requested that John Dickinson, the governor of Pennsylvania, call up the militia to defend Congress from attacks by the protesters. In what became known as the Pennsylvania Mutiny of 1783, Dickinson sympathized with the protesters and refused to remove them from Philadelphia. As a result, Congress was forced to flee to Princeton, New Jersey, on June 21, 1783, and met in Annapolis, Maryland and Trenton, New Jersey before ending up in New York, New York.
The United States Congress was established upon ratification of the United States Constitution and formally began on March 4, 1789. New York City remained home to Congress until July 1790, when the Residence Act was passed to pave the way for a permanent capital. The decision to locate the capital was contentious, but Alexander Hamilton helped broker a compromise in which the federal government would take on war debt incurred during the American Revolutionary War, in exchange for support from northern states for locating the capital along the Potomac River.
As part of the legislation, Philadelphia was chosen as a temporary capital for ten years (until December 1800), until the nation's capital in Washington, D.C. would be ready.