The city quickly grew into a major trading hub and port city, and by the mid-18th century, it was the largest city in the British colonies. During the American Revolution, New York City was occupied by the British Army from 1776 to 1783, and it served as the British political and military headquarters in North America.
Following the war, New York City became the first capital of the United States, and it was during this time that the Federal Hall, Wall Street, and the Stock Exchange were established. In 1790, the first census counted over 33,000 residents in New York City.
Throughout the 19th century, New York City continued to grow rapidly, fueled by an influx of immigrants from Europe, Ireland, and China. By 1850, the population had reached over 500,000, making New York City the largest city in the United States.
In the late 19th century, New York City underwent a period of rapid development and transformation. The city's infrastructure was modernized with the construction of new bridges, tunnels, and subways. The cityscape was also transformed with the addition of skyscrapers such as the Flatiron Building, Empire State Building, and Chrysler Building.
The 20th century was a period of continued growth and prosperity for New York City. The city became a global center for finance, commerce, and culture, and it was also a major destination for immigrants from around the world. The city's population peaked at over 8 million in 1950, and it has remained relatively stable since then.
New York City has continued to evolve and change throughout the 21st century, and it remains a vibrant and diverse city with a rich history and culture.