In 1881 French troops crossed into Tunisia from Algeria on the pretext of stopping border raids by Berber tribes. They continued on to Tunis, and under the Treaty of Bardo the country became a French protectorate, although the bey remained the head of state.
It was a period of growth for Tunisia, in terms of infrastructure, farmland and population. Yet much resentment grew as French settlers acquired land and reaped more benefits and favourable treatment than native Tunisians. Tunisians fought for France in World War I, and in World War II the country was itself a battlefield between Allied and German forces.