Philadelphia served as the United States capital from 1790 until 1800 under the Residence Act.
The federal government moved to Philadelphia after Congress passed the Residence Act of 1790. The law selected a permanent capital on the Potomac River but allowed the government to operate temporarily in Philadelphia while the new federal district was planned and built.
President George Washington worked from offices in Philadelphia, and Congress met there during the early years of the constitutional government. The city had already served as a major revolutionary center and had hosted the Continental Congress and Constitutional Convention.
The government moved to Washington, D.C., in 1800. New York City had been the first national capital under the Constitution, from 1789 to 1790, so it is a common alternative answer. Philadelphia was the second capital, while Washington, D.C., became the permanent capital selected by the Residence Act.