The Edo clan built walls to protect the town in the late 12th century. In 1457, Ōta Dōkan built Edo Castle. In 1590, Tokugawa Ieyasu made Edo his base. He became shogun in 1603, and the town became the center of his military government. This marked the beginning of the Edo period. During this time, Edo grew into one of the largest cities in the world. More than one million people lived there by the 18th century.