 After their defeat in the Spanish–American War in 1898, Spain sought compensation for its lost prestige by expanding its influence in Northern Africa.Spain had an agreement with Muley Mohamet, a local tribesman, to exploit mines around Melilla, against the wishes of Sultan Mulai Abd al-Aziz and other local tribes.On , the Rifians attacked the mines, without causing any casualties, but Muley Mohamet was apprehended and sent to Fez, where he died in prison.