The Maldives were originally settled by peoples who came from S Asia. Islam was brought to the islands in the 12th cent. Starting in the 16th cent., with the coming of the Portuguese, the Maldives were intermittently under European influence. In 1887 they became a British protectorate and military base but retained internal self-government. The Maldives obtained complete independence as a sultanate in 1965, but in 1968 the ad-Din dynasty, which had ruled the islands since the 14th cent., was ended and a republic was declared.
Following the British withdrawal from their base on the southernmost island of Gan in 1976, first the Soviet Union, then India and Sri Lanka courted Maldivian favor. Maumoon Abdul Gayoom, who was first elected president in 1978 and retained power for three decades, ruled in an authoritarian manner. Indian troops landed in the Maldives in 1988 to foil one of several coup attempts. In the late 1980s the Maldives joined with a number of coral atoll nations to raise international awareness of the consequences of global warming, and in 1989 hosted an international conference to discuss this issue.
Beginning in 2003 the country experienced occasional antigovernment demonstrations that called for political reforms. The Dec., 2004, Indian Ocean tsunami caused severe damage to many of the country's low-lying islands, and hurt the important fishing and tourist industries. In the Jan., 2005, nonpartisan elections for the Majlis, candidates supported by the banned opposition party won 18 of the elected seats. President Gayoom subsequently called for the establishment of a multiparty democracy by the end of the year, and the Majlis approved the changes in June, but opposition party leader Mohamed Nasheed was arrested at a prodemocracy rally later in the year and charged with treason and terrorism. Opposition activists continued to face repressive government measures in 2006.
Following a bombing in Sept., 2007, that was linked to Islamic militants, the president issued a wide-ranging decree designed to promote moderate Islam and suppress Islamic extremism. In Aug., 2008, a new constitution was adopted that allowed for direct election of the president, multiparty elections, and other democratic reforms; two months later, Mohamed Nasheed was elected president, defeating Gayoom after a runoff. The May, 2009, Majlis elections were won by the opposition, however, and in mid-2010 increasing tensions between the government and Majlis, especially the refusal of the Majlis to confirm supreme court appointments, led the cabinet to resign en masse in protest. In Aug., 2010, the court members were confirmed, but relations between the government and Majlis remained difficult.
During 2011 poor economic conditions led to protests against the government. After the military arrested the top criminal court judge in Jan., 2012, several weeks of demonstrations by Gayoom supporters and others culminated in a police mutiny and the forced resignation of Nasheed (February). He was succeeded as president by Vice President Mohammed Waheed Hassan. Nasheed was later (July) charged with illegally ordering the arrest of the judge. In Aug., 2012, a report by a Commonwealth-backed Maldives commission called the succession constitutional; the report led to protests in the Maldives.
Nasheed placed first in the Sept., 2013, presidential election, but he failed to win a majority, forcing a runoff with Adbulla Yameen, Gayoom's half-brother. The vote, however, was annulled by the supreme court after the third-place candidate, businessman Qasim Ibrahim, alleged vote fraud. A new election in November led to similar results, and Yameen subsequently won the runoff.