The Indian chiefdoms found by the Spaniards had achieved considerable skill in government, trade, agriculture, gold- and stonework, pottery, and weaving cotton textiles. After 18 September 1502, when Columbus landed in Limón, Spanish expeditions stayed close to the shoreline. Then, in 1562, Juan Vázquez de Coronado founded the first capital in Cartago. The Central Valley slowly became the nucleus of the nation. The Costa Rican political elite, to a great extent, has been proven to be descendants of Vázquez de Coronado and his companions. From 1569 to the end of the seventeenth century, the encomienda system was in place, and it had at least two major effects on Costa Rican society. First, it divided the Spanish into two main classes: an elite of wealthy, dominant merchants and a larger class of poor campesino criollos (Central Valley peasantry of Spanish descent). Second, the Indian population, already diminished by the epidemics, battles, and various slavery policies of the early sixteenth century, grew even smaller under the encomienda system. Mestizos were not supposed to pay tribute, and intermarriage with Indians was not encouraged. For this reason, among others, there was not an important process of mestizaje (mestizoization) at the time Indians were living in the Central Valley.
Throughout the colonial period, Costa Rica was a poor, neglected, and isolated province of small farmers. The Spanish Crown decreed that no colony was allowed to trade with any country, except Spain. Foreigners were not permitted to enter. Restrictions on commerce were greatly responsible for this poverty. Costa Rica became independent from Spain in 1821. In 1829, the first newspaper appeared. By 1844, a university had been established, and, in the 1840s, a coffee-export and marketing structure built upon British shipping and credit was organized. From that time forward, the coffee economy has influenced all aspects of daily life from personal routines to government regimes, involving all aspects of international relations. The republican type of government and a sense of nationalism developed in the nineteenth century. In spite of national unity, class divisions were marked, from the oligarchy (the coffee-exporting elite) to the rural peasantry. A railroad to the Caribbean coast, built from 1876 to 1883, made commercial growing of bananas feasible. Bananas, like coffee, were dependent on foreign investment and markets. This crop increased economic dependence on the United States, as coffee had done with respect to England.
In the 1880s there began to predominate an ideology of government called democracia liberal. Its leaders were conservatives who stood for individual liberties, the separation of church and state, and the spread of formal secular education to all sectors. Many institutions and laws date from that time, such as the National Civil Registry, the National Museum, the National Theater, and the Civil Code. The full achievement of electoral democracy is attributed to the events of 1889. The election held that year had not been rigged by the government, and candidates had sought the popular vote. The president, however, tried to impose his candidate. Peasants angrily marched on the capital, demanding respect for their choice. The 1930s and 1940s brought the decline of the liberales and the new trends of democracia social , which meant activist government and the welfare state, especially after the armed revolt in 1948, when new institutions marked a break with the past. The banking system was nationalized, taxes were imposed on wealth, the army was abolished, the civil service was institutionalized, an impartial electoral system was crafted, the franchise was extended to women, and autonomous institutions (public corporations) were created to perform basic services. From the 1960s to the 1990s, the country has experienced different development schemes that have stressed diversified agriculture, industrialization, and state socioeconomic planning. The late 1980s and the 1990s have been characterized by policies of economía neoliberal and democracia participativa ; these are attempts to reduce the role of government in the economy, limit state social programs, expand the free-market economy, join global markets, and obtain more citizen participation in decisions on public issues and solutions to national problems.