Between 1829 and 1840 the islands, including the island of Mayotte, are united under the Sultanate of Mayotte. This changes between 1843 and 1886, when the sultanate becomes as the Comoros a French protectorate. From 1896 the Comoros are administered from Reunion, but from 1908 the islands are administered from Madagascar. In 1947 the archipelago becomes a French overseas territory named Territory of the Comoros. Internal autonomy is granted in 1961.
In 1975 the archipelago achieves independence as the State of the Comoros. After a referendum the island of Mayotte decides to remain a French dependency. Ahmed Abdullah becomes the first president, but in 1976 Ali Soilih is elected president. After a coup in 1978 the Comoros become a dictatorship under Ahmad Abdullah and are renamed Federal and Islamic Republic of the Comoros. Abdullah founds the Union Comorienne pour le Progrès (Comoran Union for Progress, UPC-Udzima) als sole allowed party. Abdullah is succeeded as president and leader of the UPC by Saïd Mohamed Djohar in 1989.
With the support of the UPC Djohar is re-elected in 1990, but in 1991 Djohar breaks with the UPC to allow multi-partyism. The parliamentary elections of 1992 are the first elections on a multiparty basis. In 1993 Djohar establishes his own party, the Rassemblement pour la Démocratie et le Renouveau (Rally for Democracy and Renewal, RDR). This party wins the 1993 elections with a clear majority. In 1995 foreign mercenaries stage a coup and seize power. After a month France overcomes this coup and Djohar is restored in office. In 1996 Mohammed Taki Abdoulkarim, leader of the Union Nationale pour la Démocratie aux Comores (National Union for Democracy in the Comoros, UNDC) wins the presidential elections. The UNDC merges with other parties into the Rassemblement National pour le Développement (National Rally for Democracy, RND), that wins the parliamentary elections of 1996. Taki dies in office in 1998 and is succeeded by interim president Tajiddine Ben Said Massounde.
The army seizes power in 1999 and Azali Assoumani becomes president. After a consitutional crisis the Comoros more or less converted into a confederation in 2001 under the name Union of the Comoros and in 2002 Assoumani is re-elected as president. His followers lose the 2004 parliamentary elections.