In 1821 Central America abolished slavery and followed the example of Mexico's Agustin Iturbide and declared its independence from Spain, and the next year they became a part of his Mexican empire. When Iturbide was overthrown in 1823, the United Provinces of Central America declared their independence. That year United States president James Monroe proclaimed the paternalistic policy toward Latin America that became known as the Monroe Doctrine in order to warn Europeans not to intervene anymore in the western hemisphere. During the California gold rush in 1850 US businessmen began financing a railroad across the isthmus of Panama; it was completed after five years and was protected by US troops. Also in 1855 adventurer William Walker declared himself president of Nicaragua so that the United States could secure rights to a canal; he reestablished slavery in Nicaragua and was recognized by the US. Two years later shipping magnate Cornelius Vanderbilt helped the US invade Nicaragua to overthrow Walker with assistance from Costa Ricans at Rivas.
The United States intervened in Nicaragua four times between 1894 and 1899. After another intervention in 1910, the US Marines occupied Nicaragua for the next quarter century. A rebellion led by the mystical Augusto Sandino, a theosophist, in 1927 was not quelled until 1934, when he was treacherously murdered by order of Anastasio Somoza Garcia after he had dinner with him. Somoza established the National Guard, and his family ruled Nicaragua until 1979.
El Salvador became an independent nation in 1838, and in 1886 the communal lands were privatized as an oligarchy of mostly coffee growers called "the fourteen families" dominated the country for the next 45 years. As the Depression devastated the coffee market, the Communist Party of El Salvador (CPS) won many municipal elections in 1931; but Minister of War General Maximiliano Hernandez Martinez refused to accept the results. The Congress elected the reformer Arturo Araujo; but amid Communist agitation Farabundo Marti led a CPS revolt with Indian peasants; this was quickly defeated by the army, and in 1932 Marti and CPS leaders were publicly executed as about 30,000 peasants were massacred in the infamous la matanza. General Martinez took dictatorial power that delayed industrialization. Labor unions were illegal until Martinez was persuaded to resign by the United States in 1944 during a sit-down strike, though military rule continued. The Partido Revolutionario de Unificacion Democratica (PRUD) was founded in 1948 by Oscar Osorio, who became President in 1950, when El Salvador got a new constitution and began industrializing. The elections of 1956 were fixed by the government party (PRUD) of Lt. Col. Jose Maria Lemus.
In 1961 in response to the Cuban revolution the anti-communist Organizacion Democratica Nacionalista (ORDEN) was founded in El Salvador by General Jose Alberto Medrano. Vatican II of Pope John XXIII influenced Latin America when the bishops met at Medellin, Columbia in 1968 and were inspired to dedicate themselves to alleviating injustice and oppression. A Theology of Liberation by Gustavo Gutierrez inspired many priests to become active in social and political reforms. In 1969 after Salvadorans in Honduras were mistreated, the "Soccer War" broke out and lasted four days; about 25,000 impoverished peasants were pushed back into El Salvador, and the border was closed. Throughout the 1970s in El Salvador, Nicaragua, and Guatemala civil wars developed in reaction to government repression and right-wing death squads under General Medrano and others. San Salvador mayor Joseph Napoleon Duarte was apparently elected President in 1972, but Col. Arturo Molina of the PRUD, renamed as the Partido de Conciliacion Nacional (PCN), was chosen by the Assembly instead. After an attempted revolt by reformist officers failed, Duarte was arrested, tortured, and exiled.
The United Fruit Company had been in Guatemala for a half century when Jacobo Arbenz was elected President in 1950 to succeed peacefully Juan Jose Arévalo, who had been democratically elected in 1944. Arbenz implemented agrarian reform, but the United Fruit Company complained that they were only compensated for their 234,000 acres according to the fraudulent value they had reported on their tax forms. In 1954 mercenaries trained by the US Central Intelligence Agency (CIA) at military bases in Honduras and Nicaragua, supported by four US fighter planes, overthrew Arbenz and put Col. Carlos Castillo Armas of the National Liberation Movement (MLN) in power. Thousands of people were killed as land was returned to previous owners, taxes on interest and dividends to foreign investors were abolished, and all unions were disbanded. After President Armas was assassinated in 1957, riots resulted in the military taking control; a conservative was elected the next year. United States Special Forces began intervening in Guatemala in 1966, and in the next seven years right-wing death squads killed about 30,000 people. In 1974 a right-wing candidate seems to have stolen the election from General Rios Montt.
When President Jimmy Carter attached human rights requirements to US aid in 1977, Guatemala, El Salvador, Brazil, and Argentina refused to accept it; the next year the US banned arms sales to Guatemala. In 1982 General Rios Montt took power, and the World Council of Churches reported that the government had killed more than 9,000 people in five months. Under President Ronald Reagan in 1983 the US resumed shipping military supplies to Guatemala. Many changes of government occurred in the next few years, and the Church continued to complain of human rights abuses.
The United Fruit Company was also dominant in Honduras, which was invaded by US troops in 1923. The United States let the United Fruit Company take control and rule by a dictator from 1932 to 1948. An army coup in 1963 was led by Col. Oswaldo Lopez in 1963, who ruled until he was overthrown in 1975 when a scandal exposed that United Brands had paid an official $1.25 million and then saved $7.5 million in taxes. After Nicaragua's Somoza fell in 1979, President Carter strengthened relations with Honduras.