The city of York, Penn., was the first capital of the United States of America. The Articles of Confederation were adopted while the government convened in York, making it the de facto capital.
In 1777, the British were advancing upon Philadelphia, Penn., and due to this threat, the members of the Continental Congress were forced to move their location. Because Pennsylvania's government at the time was located in Lancaster, Penn., the Continental Congress established their location in York to avoid any confusion. While at this location, the government also signed the French Treaty of Alliance, which helped bolster the army with French assistance.