York was a town and the second capital of the colony of Upper Canada. It is the predecessor to the old city of Toronto (1834–1998). It was established in 1793 by Lieutenant-Governor John Graves Simcoe as a "temporary" location for the capital of Upper Canada, while he made plans to build a capital near today's London, Ontario. Simcoe renamed the location York after Prince Frederick, Duke of York and Albany, George III's second son. Simcoe gave up his plan to build a capital at London, and York became the permanent capital of Upper Canada on February 1, 1796. That year Simcoe returned to Britain and was temporarily replaced by Peter Russell.
The original townsite was a compact ten blocks near the mouth of the Don River and a garrison was built at the channel to Toronto Harbour. Government buildings and a law court were established. Yonge Street was built, connecting York to the Holland River to the north. To the east, Kingston Road was built to the mouth of the Trent River. In 1797, the town site was expanded to the west to allow for public buildings and expansion. One of the new area's public functions, a public market, was started in 1803. It continues today as St. Lawrence Market.
The settlement was attacked by American troops during the War of 1812. As the British garrison retreated, they detonated their powder magazine, inflicting numerous casualties on the invading U.S. forces, who proceeded to loot and destroy the town. The victorious Americans chose not to occupy the town and the British eventually returned without conflict. A reprisal attack was made on the American capital of Washington, D.C. a year later. After the war was over, the town continued to grow, expanding to the west, leaving the original town site, a less desirable location, somewhat undeveloped. A new parliament building was erected, near the original location, but this burned down and a new building was built in the new lands to the west.
A permanent fort, Fort York, was built on the site of the garrison. Dundas Street was built to connect York to towns to the west. In the 1820s, the town experienced a surge of immigrants, expanding from 1,000 residents to over 9,000 by the time the town was incorporated as the City of Toronto in 1834. During its existence, the town did not have its own government; it was governed by the province of Upper Canada, with a mix of elected officials and an aristocracy known as the Family Compact controlling the government. By 1830, this led to an ongoing political conflict, which would later lead to the 1837 Upper Canada Rebellion.