, ▁ab d ▁al - R ah mad ▁ordered ▁the ▁construction ▁of ▁a ▁fleet ▁based ▁in ▁Al mer ia . ▁The ▁cal i ph ▁helped ▁the ▁Mag h raw a ▁Ber bers ▁conquer ▁Mel illa ▁( 9 2 7 ), ▁Ce uta ▁( 9 3 1 ) ▁and ▁Tang iers ▁( 9 5 1 ), ▁which ▁accepted ▁his ▁su zer ain ty . ▁However , ▁he ▁was ▁unable ▁to ▁defeat ▁Ja wh ar ▁al - Si q illi ▁of ▁the ▁F at am ids . ▁In ▁ 9 5 1 ▁he ▁signed ▁a ▁peace ▁with ▁the ▁new ▁king ▁of ▁León , ▁Or do ño ▁III , ▁in ▁order ▁to ▁have ▁a ▁free ▁hand ▁against ▁the ▁F at im ids ▁whose ▁ships ▁were ▁har ass ing ▁the ▁cal i ph ate ▁ones ▁in ▁the ▁Mediter rane an ▁and ▁had ▁even ▁launched ▁an ▁assault ▁against ▁Al mer ia . ▁Abd ▁al - R ah man ' s ▁force , ▁led ▁by ▁prime ▁minister ▁A hm ad ▁ibn ▁Sa id , ▁bes ie ged ▁the ▁F at im id ▁port ▁of ▁Tun is , ▁which ▁bought ▁its ▁safety ▁through ▁pay ing ▁a ▁huge ▁sum . ▁ ▁In ▁the ▁end ▁he ▁was ▁able ▁to ▁create ▁a ▁prote ctor ate ▁covering ▁the ▁northern ▁and ▁central ▁Mag h reb , ▁supporting ▁the ▁Id ris id ▁dynast y ; ▁the ▁cal i ph ate ▁influence ▁in ▁the ▁area ▁disappeared ▁after ▁a ▁F at im id ▁off ensive ▁in ▁ 9 5 8 , ▁after ▁which ▁ab d ▁al - R