Tokyo was originally known as Edo, which means "estuary." In the late 12th century, Edo was fortified by the Edo clan, which built a castle and military capital (pictured below). Some of the estate's moats and walls still survive to this day. By the 1630s, Edo had a population of 150,000.

And over the next century, the small fishing village grew into the largest metropolis in the world, with a million residents by 1721.

In the 18th century, Edo became the capital of Japan. During this time, it enjoyed a long period of peace, called the Pax Tokugawa.

But this ended when American Commodore Matthew C. Perry docked in Edo in 1853. Perry negotiated the opening of two main ports with the Japanese government, leading to severe inflation and subsequent protests from residents. Japan's last shogun, Tokugawa Yoshinobu, surrendered power to Emperor Meiji in 1868. The emperor travelled to Tokyo a year later, and established Edo Castle as the imperial palace.

To this day, water lilies still cover a substantial part of Shinobazu Pond, located near the city centre. Here it is in a 1910 photo:

Tokyo City, which was already Japan's main cultural and commercial centre, was officially established 1889.

It started industrialising.

In its masterplan, the city prioritised access to major railway stations rather than large highways. This encouraged density. Tokyo also developed a network of canals in the early 20th century. Boats would distribute goods to the wharfs, warehouses, and factories on the canals' edges.

Tokyo's first tram lines opened in 1903, and the city's main train station - which serves high-speed rails today - was completed in 1914. The top photo shows the station under construction, while the bottom photo shows it soon after its opening. Tokyo's population kept climbing. By 1920, it reached 3.7 million.

Two major catastrophes hit Tokyo in the early-to-mid 20th century: the 1923 Great Kanto earthquake and World War II.

Despite the extreme loss in life and infrastructure, the city slowly recovered over the next few decades. Here is a street in Tokyo's theatre district in 1930...

...and the Asakusa temple, also in 1930.