Inhabited, before the arrival of the Spaniards, by indigenous communities not particularly civilized, despite their contacts with the Aztecs and the Maya, the current Costa Rica was conquered at the beginning of the second half of the century. XVI mainly through the work of Juan Vázquez de Coronado. The territory was incorporated into the Capitanía General of Guatemala, which in turn was incorporated into the Viceroyalty of New Spain (Mexico). The independence of Mexico therefore involved all the countries of Central America (September 15, 1821), but the head of the new Mexican state, Agustín Iturbide, did not accept the detachment of Centramerica and in January 1822 occupied the region. Shortly after the fall of Iturbide, the Central American liberals, gathered in the Constituent Assembly in Guatemala City on June 5, 1823, reaffirmed the autonomist position of 1821, summarized in the formula “neither with Spain, nor with Mexico, but with Central America”. On 1 July the republican state of the “United Provinces of Central America” was born, which dissolved in 1839, when, after a period of struggle, the members of the federative entity (Costa Rica, El Salvador, Guatemala, Honduras and Nicaragua) they separated.
The Costa Rican population, overwhelmingly of European origin, both Creole (born on the spot) and fresh immigrants, was dominated by some families of landowners, but even small ownership was widespread; this structure attenuated the social conflicts and favored a regime of peaceful paternalism. After 1860, when the cultivation of coffee developed, which brought Costa Rica into international markets, the owners of the plantations got into a fight for reasons of competition and more and more influenced the formation of governments. It resulted, in 1870, the rise to power of a caudillo, Tomás Guardia, who mainly facilitated the British, already present with considerable investments in Central America, while the American Minor Cooper Keith began the exploitation of bananas, giving life to the famous “empire” of the United Fruit Company. The US economic penetration continued under the presidency of Cleto González Víquez (1906-10), who awarded various oil concessions to US companies, and later thanks also to the policies of Ricardo Jiménez (1910-14) and Adolfo González Flores (1914-17). After the dictatorship of Federico Tinoco (1917-19), who was overthrown by a revolt, with the presidency of Julio Acosta García (1920-24) the country returned to the democratic-liberal regime and for about twenty years the presidential mandates of Ricardo Jiménez, Cleto González Víquez, Ricardo Jiménez, León Cortez and Rafael Angel Calderón Guardia were fulfilled regularly. At the electoral deadline of 1948, Rafael Angel Calderón Guardia tried, with the support of the right, to be appointed president for the second time; the voters preferred the reformist Otilio Ulate, but the Congress, dominated by the calderonistas, refused to recognize the response of the polls and ordered Ulate’s imprisonment. Calderón Guardia and T. Picado, who had been president from 1944 to 1948, asked for help from the Somoza dictators of Nicaragua and Carías Andino of Honduras.
According to usaers, the Costa Rican democrats rose up under the leadership of José María Figueres and with the moral support of the Guatemalan government. Figueres successfully completed his action: at the head of a provisional council he administered the country until November 1949, then passed power to Otilio Ulate. In 1953, as leader of the National Liberation Party, he was himself elected head of state, but four years later he had to give way to the conservative opposition leader Mario Echandi. Conservatives and reformists then alternated in power until the new presidency of Figueres (1970), followed in 1974 by the election of Daniel Oduber Quiros, also of the National Liberation Party. In 1978 the conservatives returned to the leadership of the country, with president Rodrigo Carazo Odio, exponent of the Coalition for Unity. The 1982 elections were instead won by Luis Alberto Monge Alvarez of the National Liberation Party. Involved in the Nicaragua issue, Monge Alvarez held a pro-American and anti-Sandinist line. The successor, the Social Democrat Òscar Arías Sánchez, who took office in 1986, began a more prudent policy, in concert with the Isthmian countries, in an attempt to smooth out the differences with neighboring Nicaragua, from which, to aggravate the situation, thousands of refugees arrived. In the following year, Arías Sánchez proposed an agreement for the pacification of the Central American region, also linked to the start of a democratization process, which was signed in Esquipulas by the presidents of the neighboring states (El Salvador, Nicaragua, Guatemala, Honduras). Known precisely with the name of Piano Arías, it proved capable of promoting a certain improvement in the political situation of the area and earned the promoter the Nobel Peace Prize (1987). The internal unrest (1988-89), in response to the economic policy of austerity pursued by the government, opened a phase of instability, also aggravated by the involvement of some authorities in drug trafficking. With the elections of February 1990, the leadership of the country passed to Rafael Angel Calderón Fournier, candidate of the Party of Christian Social Unity (which also obtained the parliamentary majority), while, in the 1994 elections, the leadership was again conquered by the Social Democrats, whose candidate José-Maria Figueras was elected to the presidency of the Republic. The presidential elections of February 1998 were won by Social Christian Miguel Angel Rodriguez, which got the better of José Miguel Corrales, of the Social Democratic Party. A similar outcome for the presidential elections of April 2002, which saw the Social Christian candidate, Abel Pacheco, prevail over that of the center-left opposition, Rolando Araya. The presidential elections of February 2006 were won by Oscar Arìas, with a minimum gap on his rival: Otton Solis. In October 2007, a referendum was held in which voters approved a free trade treaty with the United States. In January 2010, the vice-president Laura Chinchilla of the Liberation Party won the presidential elections, beating both the center-left candidate Otton Solis and the right-wing candidate Otto Gyuevara: it is the first time for a woman to head the country.