The French largely ended the attempts of Malagasy rulers to stymie foreign influence by declaring a protectorate over the entire island in 1894. A protectorate over northwest Madagascar, based on treaties signed with the Sakalava during the 1840s, had existed since 1882. But Queen Ranavalona III refused to recognize the 1894 effort to subordinate her kingdom to French rule. As a result, a French expeditionary force occupied Antananarivo in September 1895. A wave of antiforeign, anti-Christian rioting ensued. In 1896 France declared Madagascar a French colony and deported the queen and the prime minister--first to Reunion, then to Algeria.