Early European immigrants to Guatemala were Spaniards who conquered the indigenous Maya population in 1524. They ruled for almost 300 years. Although the Spanish conquest of Guatemala was primarily the result of its technical superiority, the Spaniards were helped by Nahua allies from central Mexico, and by indigenous Maya who were already involved in bitter struggles between rival kingdoms. Following the Spaniards' arrival, European epidemics and oppression of conquerors reduced the indigenous population from 14 million to 2 million in two generations. Currently, the population of indigenous people is nearly 5 million. Despite being greatly outnumbered by the Maya - historians estimate that only a few thousand Spaniards settled in Guatemala before independence - the latter were able to impose their colonial system through a reign of terror. As a result of Guatemala having few naturally-rich resources, like gold and silver, the Spanish conquest focused their efforts on forced labor of the indigenous population. The Spaniards established a system of domination that ensured slaves worked the land and paid taxes in the form of goods. The system is structured to exploit the indigenous population without destroying it. In 1663, King Philip IV of Spain tried to abolish slavery in the colonies, but the criollos, fought fervently to ensure that forced labor continued to practice until the early 20th century. However, when legislation to safeguard these lands was abolished in the 19th century, the criollos and Ladino soon came and established plantations producing export crops, turning the rural population into a mass of unemployed migrant farm workers. In 1821, the Republic of Guatemala - which included the Soconusco region, as well as what are now the countries of El Salvador, Honduras, Nicaragua and Costa Rica - had just 1.5 million inhabitants, mostly concentrated in the urban centers of the republic. In 1823, after a brief period as part of the Mexican Empire, the republic became known as the United Provinces of Central America. After a period of political instability exacerbated by the collapse of the world market for indigo, main exporter in the region of Europe, each province seceded from the federation, starting with Costa Rica. The federation collapsed between 1838 and 1840, when Guatemala became an independent nation. 8,507,511.