The history of Toronto, Ontario, Canada begins several millennia ago. Archaeological finds in the area have found artifacts of First Nations settlements dating back several thousand years. The Wyandot people were likely the first group to live in the area, followed by the Iroquois. When Europeans first came to Toronto, they found a small village known as Teiaiagon on the banks of the Humber River. Between visits by European explorers, the village was abandoned by the Iroquois, who moved south of Lake Ontario and the Mississaugas, a branch of the Ojibwa settled along the north shore of the lake.
The French first set up trading posts in the area, including Fort Rouillé in 1750, which they abandoned as the British conquered French North America. In 1788, the British negotiated the first treaty to take possession of the Toronto area from the Mississaugas. After the United States War of Independence, the area north of Lake Ontario was held by the British who set up the province of Upper Canada in 1791. In 1793, Lieutenant Governor moved the capital of Upper Canada to Toronto, which he named York, not wanting an aboriginal name. Simcoe originally planned for York to be a city and military outpost and set up a capital in the area of London, Ontario, but he abandoned the plan and York was named the permanent capital in 1796. The Mississaugas set up a settlement reserve in the area of Port Credit, Ontario to the west of York, and eventually moved further to the west.
Simcoe only lived in York for three years, but he directed its initial settlement on a gridiron layout near the mouth of the Don River. In 1797, the garrison which became Fort York was built at the entrance to Toronto Harbour. Tensions between the British and Americans persisted and war broke out in 1812. In 1813, the garrison was attacked and overrun by the Americans forcing the British to retreat. The Americans, who lost their commanding officer in the battle, sacked the town and burned down the government buildings, but did not take possession of York. Peace came after only two years of the war which ended in a stalemate. During peacetime, York steadily grew in population, although its infrastructure lagged, leading to the nickname of "Muddy York". As the village grew, tensions grew between the ruling class in York and growing merchant and worker classes who advocated for reforms. York was incorporated and renamed Toronto in 1834, leading to the first Toronto elections. Toronto's first mayor William Lyon Mackenzie, a reformer, persisted in his efforts to reform Upper Canada, culminating in his organization of a rebellion in 1837. Upper Canada forces defeated the rebels, and Mackenzie and others fled to the United States.
Peace again returned to Toronto and the city steadily grew during the 19th century, a major port of distribution as Upper Canada was settled. Toronto businesses grew including the meat packing business, leading to the nickname of "Hogtown". Toronto continued to grow by annexing outlying villages up until the early 1900s. After World War II, another major influx of immigrants came to the region, leading to the growth of numerous suburban villages. However, the suburban villages did not have the tax base to build the infrastructure to support the growth in population. To support the suburban growth, the Government of Ontario set up Metropolitan Toronto, a regional government encompassing Toronto and its suburbs, in 1954. The regional government built roads, water treatment and highways in Toronto, although the central city remained the largest municipality and occasionally defeated regional projects, such as the Spadina Expressway and other expressways and the clearing of the Toronto Islands. In the second half of the 20th century, Toronto surpassed Montreal as Canada's largest city and became the economic capital of the country. In 1998, the "megacity" of Toronto was formed by the dissolution of the regional government and the amalgamation of the Toronto municipalities into one municipality.