The Malagasy Protectorate was a French protectorate in what is now Madagascar. Through the protectorate, France attempted to control the foreign affairs of the Kingdom of Imerina through its representative at Antananarivo. France declared the island a protectorate in 1882 after reaching an agreement with Britain, which had been the first European power to establish a lasting influence and presence on the island that dated back to the arrival of London Missionary Society missionaries around 1820; Britain agreed to sanction French claims to Madagascar in exchange for French recognition of its claims to Zanzibar. The French justified the establishment of a protectorate on the basis of land claims over outlying islands like Nosy Be and Nosy Boraha and a treaty signed with a local leader of the western coastal Sakalava people. It was further justified through documents signed by King Radama II, including a letter he was possibly tricked into signing that entreated Napoleon to support a coup d'etat against Ranavalona I, and land ownership agreements with French industrialist Joseph-François Lambert that were revoked upon Radama's assassination in 1863. It ended in 1897 as Madagascar became a French colony.
Successive sovereigns Ranavalona II and Ranavalona III and their Prime Minister, Rainilaiarivony, rejected the claim of French protectorate status and consistently refused to acknowledge the French representative or submit to the demands of the French, who attempted to impose control over Madagascar's foreign affairs and trade. The Malagasy government sent letters to foreign trade and diplomatic allies, including Britain and the United States, to request they advocate to France on behalf of Madagascar for continued Malagasy independence. France engaged Madagascar diplomatically and bombarded coastal cities in an attempt to enforce its claims, but Madagascar continued to govern its affairs with relatively little interference.
As a result, a French expeditionary force occupied Antananarivo in September 1895 and imprisoned the queen and prime minister. In January 1897 France declared Madagascar a French colony and deported the prime minister to Algeria, where he died shortly afterward. A civil governor was put in place and key opposition figures were imprisoned or executed. The queen was allowed to continue managing certain internal affairs as a figurehead. A popular resistance movement, called the Menalamba rebellion, arose in response to the perceived corruption and ineffectiveness of the monarchy, growing European presence and influence on the island, and the spread of Christianity. After violently quelling the rebellion in 1897, the French executed key members of the royal family and sent the queen into exile first in Réunion and later Algeria, where she died in 1917.