Chile gained its independence from Spain in 1818. It established a parliamentary democracy in the late 19th century, but degenerated into a system protecting the interests of the ruling oligarchy. In the 1920s, as dissent arose from unequal power and land distribution, Marxist groups gained strong popular support. The government in the 1960s embarked on far-reaching social and economic programs, particularly in education, housing and agrarian reform, but the programs were unable to eliminate inequalities rooted in the past. Senator Salvador Allende, a Marxist and member of Chile's Socialist Party, was elected president in 1970 by a narrow margin, but he was overthrown in 1973 by a military coup led by Augusto Pinochet, who ruled until a freely elected president was installed in 1990. Chile has one of Latin America's strongest economies. Since the 1980s Chile has maintained sound economic policies that have contributed to steady growth. But it faces the challenge of diversifying its copper-dependent economy.