After 1909 stability was based more on foreign influence than by internal strength. In 1912 the government asked the U.S. government to intercede and guarantee security, which the U.S. did immediately and remained until 1933. During this period the country remained relatively stable although there were regular riots and underground movements.
Even after the removal of U.S. troops in 1933, U.S. involvement remained and in 1936 Anastasio Somoza Garcia took the presidency with U.S. support. He and his family ruled the country from this point until 1979, primarily due to political moves that included changing laws and placing relatives and family friends into positions of power.
The rule of the Somoza Garcia family was controversial and even many conservatives fought their power. Their rule also encouraged revolts from the middle class and created more extreme liberals with a tendency for violence. However, their rule was fairly stable, although heavily biased in favor of personal interests and in order to maintain U.S. support. U.S. companies controlled most of the country's lumber and beef industries as laws were altered to favor these industries.
The fall from power of the Somoza Garcia family began in 1972 when a massive earthquake struck the capital city of Managua, leading to great destruction. Both Cuba and the Soviet Union volunteered aid and hence gained greater support from the people. Two years later rebels took government officials hostage, received a ransom, and escaped, adding more pressure to the government. These actions encouraged the government to burn villages and towns suspected of supporting the liberal revolutionaries and this led to civil war in 1978 when non-violent activist Pedro Chamorro was killed.
By 1979 the government collapsed and the rebels took the country, but after the long war the country was ravaged. Cities were destroyed, diseases were rampant, and the heavy use of pesticides under Somoza Garcia rule led to bad water, leading to further deaths. This new group, the Sandinistas, won the 1984 election and soon turned to Cuba and the Soviet Union for support. This shift in political affiliations put Nicaragua squarely with the Soviets in the Cold War and tensions rose between Nicaragua and the United States, along with other Central American countries allied with the U.S.
In 1990 a surprise free election was undertaken and the Sandinistas party lost power, giving it up freely. Since this time, Nicaragua has had a fairly open and free election process as differing parties have taken power with nearly every election since 1990.