In 1821 Nicaragua achieved independence from Spain, becoming part of the United Provinces of Central America two years later. When the Federation was dissolved in 1838, Nicaragua became an independent republic. In 1909, the US sent marines to the region to support the Conservatives because Liberal leader Jose Santos Zelaya had announced his intention to pursue a canal project (the US interest was in Panama, where the canal opened in 1914). US occupation (1909-25 and 1926-33) sparked guerrilla warfare led by a Liberal officer named Sandino. In 1937, the head of the Nicaragua National Guard, named Anastasio Somoza Garcia, had Sandino assassinated and took over the Presidency himself. The Somozas controlled Nicaragua for another 42 years. The dictatorship fell in 1979 to the Sandinista National Liberation Front. For nearly a decade, the US supported the Contra forces who fought the Sandinistas in a destructive civil war. In 1990 the country held elections and the years since have been relatively peaceful.