There were two civil wars in Nicaragua. The first one, in 1978-1979, overthrew the government of Anastasio Somoza Debayle.
This revolution was led by the Sandinista National Liberation Front (FSLN), a left-wing group named for Augusto Cesar Sandino (1895-1934), who had waged a guerrilla war against U.S. occupation in the 1920s and 1930s.
The Sandinistas installed a leftist government that redistributed land to the poor, nationalized economic institutions, and improved social services. The United States called it communist. The United States accused the new Nicaragua of being a puppet for Cuba and the Soviet Union.
To try to overthrow the Sandinistas, the United States organized, funded, and trained a right-wing counterrevolutionary force called the contras (“against”). Based in Honduras, the contras began waging a guerrilla war in Nicaragua in 1983. A truce was called in 1988.
In 1990, under pressure from the contras and a U.S. trade embargo, the Sandinistas held national elections and lost. Violeta Barrios de Chamorro became president. The country has been democratically ruled since then, but there is always the danger of a reversion to civil war.
Sandinistas guard workers harvesting coffee beans in Nicaragua. Between 1983 and 1990, the countryside was wracked by violence during the guerrilla war between the Sandinistas and U.S.funded contras.