<P> New York City was greatly damaged twice by fires of suspicious origin during British military rule . The city became the political and military center of operations for the British in North America for the remainder of the war and a haven for Loyalist refugees . Continental Army officer Nathan Hale was hanged in Manhattan for espionage . In addition, the British began to hold the majority of captured American prisoners of war aboard prison ships in Wallabout Bay, across the East River in Brooklyn . More Americans lost their lives from neglect aboard these ships than died in all the battles of the war . British occupation lasted until November 25, 1783 . George Washington triumphantly returned to the city that day, as the last British forces left the city . </P> <P> Starting in 1785 the Congress met in New York City under the Articles of Confederation . In 1789, New York City became the first national capital of the United States under the new United States Constitution . The Constitution also created the current Congress of the United States, and its first sitting was at Federal Hall on Wall Street . The first United States Supreme Court sat there . The United States Bill of Rights was drafted and ratified there . George Washington was inaugurated at Federal Hall . New York City remained the capital of the U.S. until 1790, when the role was transferred to Philadelphia . </P> <P> During the 19th century, the city was transformed by immigration, a visionary development proposal called the Commissioners' Plan of 1811 which expanded the city street grid to encompass all of Manhattan, and the opening of the Erie Canal in 1825, which connected the Atlantic port to the vast agricultural markets of the Midwestern United States and Canada . By 1835, New York City had surpassed Philadelphia as the largest city in the United States . New York grew as an economic center, first as a result of Alexander Hamilton's policies and practices as the first Secretary of the Treasury . </P> <P> In 1842, water was piped from a reservoir to supply the city for the first time . </P>

When did new york became the largest city