Settled as a colony of Spain in the 1520s, Nicaragua gained its independence in 1821. Violent opposition to governmental manipulation and corruption spread to all classes by 1978 and resulted in a short-lived civil war that brought the Marxist Sandinista guerrillas to power in 1979. Nicaraguan aid to leftist rebels in El Salvador caused the US to sponsor anti-Sandinista contra guerrillas through much of the 1980s. Free elections in 1990 and again in 1996 saw the Sandinistas defeated. The country has slowly rebuilt its economy during the 1990s, but was hard hit by Hurricane Mitch in 1998.