Peru as loose confederation of cities scattered along the coast of northern Peru and southern Ecuador, the Chimu flourished from about 1140 to 1450. Their capital was at Chan Chan outside of modern-day Trujillo. In the highlands, both the Tiahuanaco culture, near Lake Titicaca in both Peru and Bolivia, and the Wari culture, near the present-day city of Ayacucho, developed large urban settlements and wide-ranging state systems between 500 and 1000 AD. In the 15th century, the Incas emerged as a powerful state which, in the span of a century, formed the largest empire in pre-Columbian America with their capital in
Hispanic America the vast Spanish Empire. Napoleon's takeover of Spain in 1808 and the consequent chaos initiated the dismemberment of the Spanish Empire, as the Hispanic American territories began their struggle for emancipation. By 1830, the only remaining Spanish American and Asian territories were the Philippine archipelago and the islands of Cuba and Puerto Rico, until the 1898 Spanish–American War. Spanish is the official language in most Hispanic American countries, and it is spoken by the vast majority of the population. Native American languages are widely spoken in Peru, Guatemala, Bolivia, Paraguay and Mexico, and to a lesser degree, in Panama, Ecuador,