▁as ▁a ▁Spanish ▁prote ctor ate ▁with ▁its ▁capital ▁at ▁T etu án . ▁ ▁The ▁Prote ctor ate ▁system ▁was ▁established ▁in ▁ 1 9 1 2 . ▁The ▁Islam ic ▁legal ▁system ▁of ▁q ad is ▁was ▁formally ▁maintained . ▁ ▁R if ▁War ▁▁ ▁Following ▁the ▁First ▁World ▁War , ▁the ▁Republic ▁of ▁the ▁R if , ▁led ▁by ▁the ▁gu err illa ▁leader ▁Abd ▁el - K rim , ▁was ▁a ▁break away ▁state ▁that ▁existed ▁from ▁ 1 9 2 1 ▁to ▁ 1 9 2 6 ▁in ▁the ▁R if ▁region , ▁when ▁it ▁was ▁sub du ed ▁and ▁dissol ved ▁by ▁joint ▁expedition ▁of ▁the ▁Spanish ▁Army ▁of ▁Africa ▁and ▁French ▁forces ▁during ▁the ▁R if ▁War . ▁ ▁The ▁Spanish ▁lost ▁more ▁than ▁ 1 3 , 0 0 0 ▁soldiers ▁at ▁Ann ual ▁in ▁July – August ▁ 1 9 2 1 . ▁Cont ro vers y ▁in ▁Spain ▁over ▁the ▁early ▁conduct ▁in ▁the ▁war ▁was ▁a ▁driving ▁factor ▁behind ▁the ▁military ▁coup ▁by ▁General ▁The ▁ 2 nd ▁Mar qu és ▁de ▁Est ella ▁in ▁ 1 9 2 3 ▁which ▁for esh adow ed ▁the ▁Spanish ▁Civil ▁War ▁of ▁ 1 9 3 6 – 3 9 . ▁ ▁After ▁the ▁successful ▁ 1 9 2 5 ▁Al h uc emas ▁landing , ▁the ▁French – Span ish ▁al liance ▁ended ▁up ▁ach ieving ▁victory ▁and ▁putting ▁an ▁end ▁to ▁the ▁war . ▁ ▁Second ▁Spanish ▁Republic ▁ ▁Before ▁ 1