Spain divided up their world into three primary viceroyalties: New Spain, New Castile, and New Granada.
New Spain included the areas now known as the western United States and the Louisiana Purchase, Mexico, northern Central America, the Caribbean, and the Philippines. The capital city of New Spain was Mexico City.
New Castile included all of South America, except the Portuguese territories of Brazil and the British, French, and Dutch Guyanas (or Guianas). The capital city of New Castile was Lima (now the capital of Peru.)
New Grenada was the region that encompassed Panama, Colombia, Venezuela, and Ecuador. The capital city of New Grenada was Bogota (now the capital of Colombia).
Additional Spanish possessions were developed in Africa - Equatorial Guinea (which remains the only Spanish-speaking country in Africa) and Morocco.
As the constituent territories of the Spanish Empire gained independence (such as Mexico's independence in 1810), the Spanish Empire dwindled to today to include the country of Spain and the tiny territories of Ceuta and Melilla in northern Africa.