In the late 19th century, Britain and Italy gained control of parts of the Somali coast and established protectorates. In the interior, Somali leader Sayid Mohammed Abdullah Hassan led armed resistance against the British, Italians, and Ethiopians for 20 years from his Dervish state. Some regard Hassan as a pioneer of Somali nationalism for resisting foreign occupation. He was finally defeated in 1920 after several victories over invading forces.