Subsequent French missions were more fortunate, and in 1897 Emile Gentil, the French commissioner for the district, concluded a treaty with the sultan of Bagirmi, placing his country under French protection. A resident was left at the capital, Massenya, but on Gentil's withdrawal Rabah descended from Bornu and forced sultan and resident to flee. It was not until after the death of Rabah in battle and the rout of his sons (1901) that French authority was firmly established.