In 1979, the Sandinista National Liberation Front (FSLN) overthrew Anastasio Somoza Debayle, ending the Somoza dynasty, and established a revolutionary government in Nicaragua. Following their seizure of power, the Sandinistas ruled the country first as part of a Junta of National Reconstruction. Following the resignation of centrist members from this Junta, the FSLN took exclusive power in March 1981.

Oppositional rebels, known as Contras, formed in 1981 to resist the Sandinista's Junta and received support from the American Central Intelligence Agency. The 1984 elections, described by international observers as fair and free,  were boycotted by the main opposition party. The FSLN won the majority of the votes. Those who did oppose the Sandinistas won approximately a third of the seats. Despite the clear electoral victory for the Sandinistas, the Contras continued their violent attacks on both state and civilian targets, until 1989. The FSLN lost elections in 1990 to Violeta Barrios de Chamorro, after revising the constitution in 1987 and after years of resisting the United States-supported Contras, but retained a minority of seats in the legislature.

Nicaraguan Revolution

The FSLN evolved from one of many opposition groups to a leadership role in the overthrow of the Somoza regime. By mid-April 1979, five guerrilla fronts opened under the joint command of the FSLN, including an internal front in the capital city Managua. Young guerrilla cadres and the National Guardsmen were clashing almost daily in cities throughout the country. The strategic goal of the Final Offensive was the division of the enemy's forces. Urban insurrection was the crucial element because the FSLN could never hope to achieve simple superiority in men and firepower over the National Guard.

On June 4, a general strike was called by the FSLN to last until Somoza fell and an uprising was launched in Managua. On June 16, the formation of a provisional Nicaraguan government in exile, consisting of a five-member Junta of National Reconstruction, was announced and organized in Costa Rica. The members of the new junta were Daniel Ortega (FSLN), Moisés Hassán (FPN), Sergio Ramírez (the "Twelve"), Alfonso Robelo (MDN) and Violeta Barrios de Chamorro, the widow of La Prensa's director Pedro Joaquín Chamorro. By the end of that month, with the exception of the capital, most of Nicaragua was under FSLN control, including León and Matagalpa, the two largest cities in Nicaragua after Managua.

On July 9, the provisional government in exile released a government program, in which it pledged to organize an effective democratic regime, promote political pluralism and universal suffrage, and ban ideological discrimination, except for those promoting the "return of Somoza's rule". On July 17, Somoza resigned, handed over power to Francisco Urcuyo, and fled to Miami. While initially seeking to remain in power to serve out Somoza's presidential term, Urcuyo seceded his position to the junta and fled to Guatemala two days later.

On July 19, the FSLN army entered Managua, culminating the first goal of the Nicaraguan revolution. The war left approximately 50,000 dead and 150,000 Nicaraguans in exile. The five-member junta entered the Nicaraguan capital the next day and assumed power, reiterating its pledge to work for political pluralism, a mixed economic system, and a nonaligned foreign policy.

Council of National Reconstruction (1979–1980)
The Sandinistas inherited a country in ruins with a debt of 1.6 billion dollars (US), an estimated 50,000 war dead, 600,000 homeless, and a devastated economic infrastructure. To begin the task of establishing a new government, they founded a Council (or ) of National Reconstruction, made up of five appointed members. Three of the appointed members belonged to FSLN, which included – Sandinista militants Daniel Ortega, Moisés Hassán, and novelist Sergio Ramírez (a member of Los Doce "the Twelve"). Two opposition members, businessman Alfonso Robelo, and Violeta Barrios de Chamorro (the widow of Pedro Joaquín Chamorro), were also appointed. Only three votes were needed to pass law.

The FSLN also established a Council of State, subordinate to the junta, which was composed of representative bodies. However, the Council of State only gave political parties twelve of forty-seven seats, the rest of the seats were given to Sandinista mass-organizations. Of the twelve seats reserved for political parties, only three were not allied to the FSLN. Due to the rules governing the Council of State, in 1980 both non-FSLN junta members resigned. Nevertheless, as of the 1982 State of Emergency, opposition parties were no longer given representation in the council.

The preponderance of power also remained with the Sandinistas through their mass organizations, including the Sandinista Workers' Federation (), the Luisa Amanda Espinoza Nicaraguan Women's Association (), the National Union of Farmers and Ranchers (), and most importantly the Sandinista Defense Committees (CDS). The Sandinista controlled mass organizations were extremely influential over civil society and saw their power and popularity peak in the mid-1980s.

Sandinista period (1979 - 1990) 
As Nicaragua's government collapsed and the National Guard commanders escaped with Somoza, the U.S. first promised and then denied them exile in Miami. The rebels advanced on the capital victoriously. On July 19, 1979, a new government was proclaimed under a provisional junta headed by 35-year-old Daniel Ortega and including Violeta Chamorro, Pedro's widow.

The United Nations estimated material damage from the revolutionary war to be US$480 million. The FSLN took over a nation plagued by malnutrition, disease, and pesticide contaminations. Lake Managua was considered dead because of decades of pesticide runoff, toxic chemical pollution from lakeside factories, and untreated sewage. Soil erosion and dust storms were also a problem in Nicaragua at the time due to deforestation. To tackle these crises, the FSLN founded the Nicaraguan Institute of Natural Resources and the Environment.

Contras and State of Emergency

The first challenge to the powerful new army came from the Contras, groups of Somoza's National Guard who had fled to Honduras. 
The Contras were soon under the control of Nicaraguan business elites who opposed Sandinista policies to seize their assets. The Contra chain of command included some ex-National Guardsmen, including Contra founder and commander Enrique Bermúdez and others. One prominent Contra commander, however, was ex-Sandinista hero Edén Pastora, aka "Commadante Zero," who rejected the Leninist orientation of his fellow comandantes.

With the election of Ronald Reagan in 1980, relations between the United States and the Sandinista regime became an active front in the Cold War. The Reagan administration insisted on the "Communist threat" posed by the Sandinistas—reacting particularly to the support provided to the Sandinistas by Cuban president Fidel Castro, by the Sandinistas' close military relations with the Soviets and Cubans, but also furthering the Reagan administration's desire to protect U.S. interests in the region, which were threatened by the policies of the Sandinista government. The United States quickly suspended aid to Nicaragua and expanded the supply of arms and training to the Contra in neighbouring Honduras, as well as allied groups based to the south in Costa Rica. President Reagan called the Contras "the moral equivalent of our founding fathers."

In March 1982 the Sandinistas declared an official State of Emergency. They argued that this was a response to attacks by counter-revolutionary forces. The State of Emergency lasted six years, until January 1988, when it was lifted.

Under the new "Law for the Maintenance of Order and Public Security" the "Tribunales Populares Anti-Somozistas" allowed for the indefinite holding of suspected counter-revolutionaries without trial. The State of Emergency, however, most notably affected rights and guarantees contained in the "Statute on Rights and Guarantees of Nicaraguans. Many civil liberties were curtailed or canceled such as the freedom to organize demonstrations, the inviolability of the home, freedom of the press, freedom of speech and, the freedom to strike.

All independent news program broadcasts were suspended. In total, twenty-four programs were cancelled. In addition, Sandinista censor Nelba Cecilia Blandón issued a decree ordering all radio stations to hook up every six hours to government radio station, La Voz de La Defensa de La Patria. The rights affected also included certain procedural guarantees in the case of detention including habeas corpus.

In 1982, legislation was enacted in the U.S. to prohibit further direct aid to the Contras. Reagan's officials attempted to illegally supply them out of the proceeds of arms sales to Iran and third party donations, triggering the Iran-Contra Affair of 1986-87.

1984 Election

The Sandinistas were victorious in the national election of November 4, 1984, gathering 67% of the vote. The election was certified as "free and fair" by the majority of international observers. Other observers, the Nicaraguan political opposition and the Reagan administration claimed political restrictions were placed on the opposition by the government, and that a relatively short period of greater openness was not sufficient for a free election. The primary opposition candidate was the U.S.-backed Arturo Cruz, who succumbed to pressure from the United States government not to take part in the 1984 elections; later US officials were quoted as saying, "the (Reagan) Administration never contemplated letting Cruz stay in the race, because then the Sandinistas could justifiably claim that the elections were legitimate...Other Administration officials vehemently denied this contention. L. Craig Johnstone, Deputy Assistant Secretary of State for Central America, said...'Anyone who would allege that we don't favor full participation in the election doesn't know what he's talking about.'"  Other opposition parties such as the Conservative Democratic Party and the Independent Liberal party, were both free to denounce the Sandinista government and participate in the elections.

Cambridge historian Christopher Andrews claimed that it was later discovered that the FSLN had, in fact, been actively suppressing right-wing opposition parties while leaving moderate parties alone, with Ortega claiming that the moderates "presented no danger and served as a convenient facade to the outside world". In 1993, the Library of Congress wrote "Foreign observers generally reported that the election was fair. Opposition groups, however, said that the FSLN domination of government organs, mass organizations groups, and much of the media created a climate of intimidation that precluded a truly open election.". Ortega was overwhelmingly elected president in 1984, but the long years of war had decimated Nicaragua's economy and widespread poverty ensued.

1990 election 
The long war against the Contras severely weakened Nicaraguan economy, weakening the position of the Sandinistas. The elections of 1990, which had been mandated by the constitution passed in 1987, saw the Bush administration funnel $49.75 million of ‘non-lethal’ aid to the Contras, as well as $9m to the opposition UNO—equivalent to $2 billion worth of intervention by a foreign power in a US election at the time, and proportionately five times the amount George Bush had spent on his own election campaign.  When Violetta Chamorro visited the White House in November 1989, the US pledged to maintain the embargo against Nicaragua unless Violeta Chamorro won.

In August 1989, the month that campaigning began, the Contras redeployed 8,000 troops into Nicaragua, after a funding boost from Washington, becoming in effect the armed wing of the UNO, carrying out a violent campaign of intimidation. No fewer than 50 FSLN candidates were assassinated. The Contras also distributed thousands of UNO leaflets.

Years of conflict had left 50,000 casualties and $12b of damages in a society of 3.5m people and an annual GNP of $2b. The proportionately equivalent figures for the US would have been 5 million casualties and $25 trillion lost. After the war, a survey was taken of voters: 75.6% agreed that if the Sandinistas had won, the war would never have ended. 91.8% of those who voted for the UNO agreed with this. (William I Robinson, op cit) The Library of Congress Country Studies on Nicaragua states:

See also
List of years in Nicaragua

References

History of Nicaragua by period
1979 in Nicaragua
1980s in Nicaragua
1980 in Nicaragua
1989 in Nicaragua
1990 in Nicaragua