The present Republic of Djibouti occupies an area in the horn of Africa which had been converted to Islam as far back as the 9th Century and ruled for centuries by the local Afar and Issa tribes, under the influence of Arabian traders. There were a few small sultanates here, including the Afar (Danakil) Sultanate of Tadjoura; a plain red flag was flown here, which was also common among most states along the Arabian peninsula. Tadjoura's Sultan (or "Dardar" as he was called), signed a treaty with the French allowing them to moor in his port in 1862. The French called the land around there Obock, until they declared it a colony in 1894 under the name of "Côte française des Somalis" (lit. French coast of the Somalis), or French Somaliland, centred around the newly built city of Djibouti; the Tadjoura Sultanate was incorporated in the colony. The French tricolour was the only flag flown from there on.
A referendum had been held in 1958 to determine if the territory should join Somali upon its independence in 1960, that resulted in a vote to remain French, mainly because of the Afar people being against joining Somalia and vote rigging by the French who had expelled thousands of Issa Somalis. The United Nations recommended in 1966 that independence should be granted, and a second plebiscite was held in 1967 after French President Charles de Gaulle had been greeted with demonstrations and rioting when he visited. The result was the same as in the first referendum, for exactly the same reasons but the territory was renamed that year "Territoire français des Afars et des Issas", French Territory of the Afars and Issas in acknowledgement of the large Afar population and downplaying the significance of the Issa Somalis. The French flag continued to be flown.
Finally, on 27 June 1977, the country gained independence as the Republic of Djibouti and its National flag, designed by independentist leader Mr. Mahamoud Harbi, was officially hoisted. The colours were interpreted as: white - peace, light blue - sea and sky, green - earth. The red star is for unity. The flag had already been flown in 1972 by the African National Liberation Union, but then the colour green stood for the Afar people and light blue for the Issas, the ethnic Somalis, who had originally voted for the country to join the new Republic of Somalia, with its light blue flag.