US-backed dictator Anastasio Somoza Debayle ruled Nicaragua from 1967 until his resignation in 1979. The Sandinista National Liberation Front (FSLN, Sandinistas), Nicaragua's socialist party that is dominant in the politics of the country today, was founded by members of various activist organizations in 1961. The group grew stronger during Somoza's rule, and by the early 1970s was launching guerrilla attacks against the government. By the end of June 1979, the FSLN controlled most of Nicaragua, and a provisional government in exile (the Junta of National Reconstruction) was formed in collusion with the right-wing opposition against Somoza. Somoza resigned on 17 July that same year, and after the successor appointed by him stepped down from his position, the junta officially became Nicaragua's government.

After Somoza was overthrown, many members of his former National Guard fled to Honduras, where they were trained by the CIA as a counter-revolutionary force (the Contras) to fight the new government in Nicaragua. The Contras tactically terrorized and murdered civilians, thereby following the written instructions in violence and destabilization that they received from the CIA.

Although thirteen-thousand kilometres apart, Iran and Nicaragua are connected by a chapter of recent history that came to be known as the Iran-Contra affair. The link is personified in a group of people ‘doing things with the authority of and at the direction of the White House’ (Jonathan Kwitny, journalist, author of Endless Enemies: The Making of an Unfriendly World), notably Oliver North (US Marine Corps officer and military aide to Reagan's National Security Council), Richard Secord (US Air Force), and CIA officer Thomas Clines. This group facilitated sales of arms to the Islamic Republic of Iran, which were made in violation of US sanctions against Iran.

From November 1979, 52 American diplomats and citizens were held hostage in Iran by student supporters of the Iranian Revolution. In February 1979, Ruhollah Khomeini, leader of the Iranian Revolution, returned to Iran after 14 years of exile. The Shah of Iran, Mohammad Reza Pahlavi, was overthrown, and the civilian government of Bakhtiar, who had been appointed Prime Minister by the Shah, collapsed, which marks the establishment of the Islamic Republic of Iran. There are allegations that, before the 1980 election, Reagan cut a deal with Khomeini to the effect of delaying the release of the hostages until after the election. In exchange, the US would sell arms to Iran. While inquiries held by Congress concluded that there was insufficient evidence, the allegations are supported by Barbara Honegger (Reagan's former campaign staffer and policy analyst), Abolhassan Banisadr (former president of Iran), and a 1980 CIA memo declassified in 2017. The Islamic Republic of Iran in fact announced the release of the hostages on the day of Reagan's inauguration.

In 1984, Congress enacted the Boland amendment, which specifically prohibited the use of US government money for supporting the overthrow of the Nicaraguan government. It remained in effect until 1986. Nevertheless, the group around North/Secord/Clines was selling arms to Iran at heavily marked up prices, and millions in profits were secretly diverted to the Contras while the amendment was in effect.

In the congressional hearings on the Iran-Contra affair held in 1987, Oliver North is asked what might happen if the US does not support the Nicaraguan 'democratic resistance', to which North replies:

‘The consolidation of the communist regime in Managua will result in the spread of that revolution, as they themselves have advocated. You'll see democracy perish in the rest of Central America.’

The Reagan administration's position in its policy with respect to Nicaragua is that the end justifies the means. With a higher goal in mind, it becomes acceptable to subvert domestic and international law. Illegal arms trade, drug trafficking, assassinations: these all become means to a noble end when viewed within the narrative of the fight against communism.