By the end of 1978, the failure of the FAO [Broad Opposition Front (Frente Amplio de Oposición--FAO)] to obtain a negotiated solution increased the stature of the insurrection movement. In October, Los Doce [the Group of Twelve] withdrew from the negotiation process when the FAO persisted in seeking a negotiated settlement with the dictator, and many of FAO's members resigned in protest over the negotiations with Somoza. The insurrection movement, meanwhile, gathered strength and increased the fighting. The Somoza regime was further isolated and discredited when in November the Organization of American States (OAS) Inter-American Commission on Human Rights published a report charging the National Guard with numerous violations of human rights. The report was followed by a United Nations (UN) resolution condemning the Nicaraguan government. In December 1978, the FSLN was further strengthened when Cuban mediation led to an agreement among the three FSLN factions for a united Sandinista front. Formal unification of the FSLN occurred in March 1979.
A mediation process led by the OAS collapsed during January 1979, when President Somoza refused to hold a national plebiscite and insisted on staying in power until 1981. As fighting increased, the Nicaraguan economy faced a severe economic crisis, with a sharp decline in agricultural and industrial production, as well as high levels of unemployment, inflation, defense spending, and capital flight. The government debt also increased mostly as a result of defense expenditures and the gradual suspension of economic support from all international financial institutions.
On February 1, 1979, the Sandinistas established the National Patriotic Front (Frente Patriótico Nacional--FPN), which included Los Doce, the PLI, and the Popular Social Christian Party (Partido Popular Social Cristiano--PPSC). The FPN had a broad appeal, including political support from elements of the FAO and the private sector. After the formal unification of the Sandinista guerrillas in March, heavy fighting broke out all over the country. By then the FSLN was better equipped, with weapons flowing from Venezuela, Panama, and Cuba, mostly through Costa Rica. The FSLN launched its final offensive during May, just as the National Guard began to lose control of many areas of the country. In a year's time, bold military and political moves had changed the FSLN from one of many opposition groups to a leadership role in the anti-Somoza revolt.
On June 18, a provisional Nicaraguan government in exile, consisting of a five-member junta, was organized in Costa Rica. Known as the Puntarenas Pact, an agreement reached by the new government in exile called for the establishment of a mixed economy, political pluralism, and a nonaligned foreign policy. Free elections were to be held at a later date, and the National Guard was to be replaced by a nonpartisan army. The members of the new junta were Daniel José Ortega Saavedra of the FSLN, Moisés Hassan Morales of the FPN, Sergio Ramírez Mercado of Los Doce, Alfonso Robelo Callejas of the MDN, and Violeta Barrios de Chamorro, the widow of La Prensa's editor. Panama was the first country to recognize the junta. By the end of June, most of Nicaragua was under FSLN control, with the exception of the capital. President Somoza's political and military isolation finally forced him to consider resignation. The provisional government in exile released a government program on July 9 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." By the second week of July, President Somoza had agreed to resign and hand over power to Francisco Maliano Urcuyo, who would in turn transfer the government to the Revolutionary Junta. According to the agreement, a cease-fire would follow, and defense responsibilities would be shared by elements of the National Guard and the FSLN.
On July 17, 1979, Anastasio Somoza Debayle resigned, handed over power to Urcuyo, and fled to Miami. The former Nicaraguan dictator then established residence in Paraguay, where he lived until September 1980, when he was murdered, reportedly by leftist Argentine guerrillas. After President Somoza left Nicaragua in 1979, many members of the National Guard also fled the country, seeking asylum in neighboring countries, particularly in Honduras and Guatemala. Others turned themselves in to the new authorities after the FSLN took power, on promises of amnesty. They were subsequently tried and many served jail terms. The five-member junta arrived in the city of León a day after Somoza's departure, on July 18. Urcuyo tried to ignore the agreement transferring power, but in less than two days, domestic and international pressure drove him to exile in Guatemala. On July 19, the FSLN army entered Managua, culminating the Nicaraguan revolution. The insurrection 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.