This article analyzes the political role of Sufism in Somalia in the beginning of the 20th century. Attention is paid mainly to the uprising of Maxamed ibn Cabdalla Xasan during the first two decades of the twentieth century and its importance not only for the British Somaliland, but for the south part of Somalia as well. In the south, the revolt was less successful mainly due to the inability to overcome the clan differences. Even today Maxamed ibn Cabdalla Xasan is labeled by Somalis as a national hero. So his role and the role of darvish uprising in the creation and formation of ideas of Somali nationalism is also mentioned in this study.