The territory that now comprises the State of Mexico once formed the core of the Pre-Hispanic Aztec Empire. During the Spanish colonial period, the region was incorporated into New Spain. After gaining independence in the 19th century, Mexico City was chosen as the capital of the new nation; its territory was separated out of the state. Years later, parts of the state were broken off to form the states of Hidalgo, Guerrero and Morelos. These territorial separations have left the state with the size and shape it has today, with the Toluca Valley to the west of Mexico City and a panhandle that extends around the north and east of this entity.