New Mexico was first settled ten millennia ago, by Pueblo Indians who built cities and sophisticated irrigation systems. Pueblo ruins are found throughout the state. The Pecos National Historical Park, near Santa Fe, conserves the remains of the Pecos pueblo, which in 1450 had buildings five stories high that housed more than 2,000 people. The Chaco Culture National Historical Park in northwestern New Mexico preserves the ruins of an important Pueblo city, which was inhabited between 850 to 1250 A.D. The city at Gila Cliff Dwellings National Monument was built by the Mogollon people, who lived there from the about 1280 A.D. until the early 1300s.
Spanish explorers arrived in New Mexico in 1540, led by Francisco Vásquez de Coronado. The Spanish began building settlements in the 1590s, with the goals of converting Native Americans to Christianity and striking it rich by mining silver. Founded around 1607, Santa Fe, the modern state's capital, was also the capital of Spanish New Mexico and was the first permanent European settlement west of the Mississippi.
Built in 1610, the Palace of the Governors in Santa Fe is the oldest continuously used public building in the country. Today, it a museum of New Mexican History, with photographs, art and artifacts dating to the 16th century. A few blocks south is the San Miguel Mission, the oldest church in the country.
New Mexico was part of an independent Mexico from 1821 until the Mexican War, when the United States seized it. In its early years, New Mexico Territory was characterized by lawlessness and violence. The notorious outlaw Billy the Kid (whose real name was either William H. Bonney, Jr. or Henry McCarty) famously escaped from the Lincoln County Courthouse, which today is part of the Lincoln State Monument. The Kid was shot dead in 1881 by Sheriff Patrick Floyd Garrett in Fort Sumner, at the age of 21. His grave is in that town, and the Billy the Kid Museum exhibits related artifacts, including a historic wanted poster and locks of his hair.
Wherever gold was discovered in the late 19th century, boom towns sprang up in the desert. Today, many of those once-prosperous settlements are ghost towns. Several abandoned buildings—including a saloon, schoolhouse and miner's home—have been preserved or restored in White Oaks, in Lincoln County, where vast gold deposits were discovered in 1878 and exhausted by 1900.