The United States actively intervened in helping the ouster of Nicaraguan President Zelaya. When the government that replaced him was itself attacked the US sent troops to defend it in 1913. Those troops remained for over 10 years.
Nicaraguan President Jose Zelaya came to power as a result of a military coup in 1893. He solicited help from foreign powers to help develop the country. After the United States decided not to build its canal in Nicaragua but in Panama Zelaya turned to the Japanese about building a canal. In 1909 a revolt broke out against Zelaya, and the US gave the rebels covert support. When two American citizens who served with the insurgents were captured and then executed the US saw a reason to intervene. US Marines landed on the Caribbean coast, and the rebels were able to take the offensive and capture the capital Managua. The US recognized the new rebel government.
The US had initially pushed for elections in six months but when it became clear to the US representative that Zelaya’s party would win an election. They convinced the rebel leader Juan Estrada to have an assembly elect him which it did. In one 1911 the Nicaraguan government and the US signed a treaty that gave the US corporation control on important Nicaraguan assets. Estrada had internal rivals, and Adolfo Diaz succeeded him.
IN July 1912 Diaz political rival Luis Mena who was the minister of war began a revolt against Diaz. Diaz asked for US help, and the US sent 2,000 marines to help him. Mena fled the country, and Diaz maintained control. The US kept Marines in the country to show its support for the government.