Madagascar was created when it separated from the Gondwana supercontinent about 160 million years ago. At the time it was connected to India, which split off and drifted away approximately 90 million years later.
The island was settled by ancient voyagers from Indonesia between 200 and 500 A.D. East Africans were also early settlers having crossed the Mozambique Channel around the same time. Arabs came to the northern shores in the 7th century and began the written history of the Malagasy, whose language was first transcribed using a modified Arabic writing system called Sorabe. Sorabe was later used by the Merina king Andrianampoinimerina to spread literacy throughout his kingdom in the 17th century.
The first Europeans to visit Madagascar were the Portuguese in the year 1500, followed by the French in 1666. During the late 18th and early 19th century Madagascar hosted many popular European and American pirates enclaves. American pirates brought Malagasy rice to the states where it took readily to southern soil.
From the late 18th century most of Madagascar was ruled by a succession of powerful Merina monarchs beginning with Andrianampoinimerina and ending with Ranavalona III. During much of this time Madagascar enjoyed strong relations with the British, who provided financial and military assistance. The French invaded in 1883, and in 1896 Madagascar was annexed into the French empire.
In 1942 the British briefly seized Madagascar to prevent it from falling into Japanese hands. Shortly after, the Free French, a group that continued fighting the Axis powers after France's surrender, took control of the island. After a bloody uprising in 1947 Madagascar began its gradual move toward independence. The Malagasy Republic became a fully autonomous country on June 26, 1960.