The Second Rif War or Second Melillan campaign (Spanish: Campaña or Guerra de Melilla ) was a conflict in 1909 in Morocco around Melilla.
The fighting involved local Riffians and the Spanish Army.
The Treaty of Peace with Morocco that followed the 1859-1860 War entailed the acquisition of a new city perimeter for Melilla, bringing its area to the 12 km2 the city currently stands. Following the declaration of Melilla as free port in 1863, the population began to increase, chiefly by Sephardi jews fleeing from Tetouan who fostered trade in and out the city. The new 1894 agreement with Morocco that followed the 1893 Margallo War between Spaniards and Riffian tribesmen increased trade with the hinterland, bringing the economic prosperity of the city to a new level.
The turn of the new century saw however the attempts by France (based in French Algeria) to profit from their newly acquired sphere of influence in Morocco to counter the trading prowess of Melilla by fostering trade links with the Algerian cities of Ghazaouet and Oran. Melilla began to suffer from this, to which the instability brought by revolts against Muley Abdel Aziz in the hinterland also added, although after 1905 Sultan pretender El Rogui Bou Hmara carried out a defusing policy in the area that favoured Spain. The 1906 Algeciras Conference sanctioned the French and Spanish direct intervention in Morocco. French hastened to occupy Oujda in 1907, compromising the Melillan trade with that city. The enduring instability in the Rif still threatened Melilla. After the 12 March 1908 Spanish occupation of Ras Kebdana, that offered a starting point for further potential intervention in the Moulouya basin, foreign mining companies began to enter the area. A Spanish one, the Compañía Española de las Minas del Rif [es], was constituted in July 1908, shared by Clemente Fernández, Enrique Macpherson, the Count of Romanones, the Duke of Tovar [es] and Juan Antonio Güell [es], who appointed Miguel Villanueva as chairman.
On 08 August 1908, the Riffians attacked the mines, without causing any casualties, but Muley Mohamet was apprehended and sent to Fez, where he died in prison. Amid conflict with the Riffian tribes, Bou Hmara, lacking enough Spanish support, was forced out from the area in late 1908. Without support in hostile territory, General José Marina Vega, military commander of Melilla, asked the Government of Spain for reinforcements to protect the mines, but none were sent. On 09 July 1909, a new attack occurred and a number of Spanish railway workers were killed by tribesmen, prompting a retaliatory offensive ordered by Marina Vega during which several positions near Melilla were occupied.
As a result of these deaths, Prime Minister Antonio Maura increased the Spanish garrison at Melilla from 5,000 men to 22,000 in preparation for an offensive. All the Spanish forces involved were conscripts; at this stage, Spain had neither professional troops, nor indigenous troops under arms. The Spanish army was poorly trained and equipped and lacked basic maps.
The impressment in Mainland Spain that followed the beginning of the conflict would bring the insurrection of the popular classes (the unjust system provided the wealthy with facilities to avoid impressment), spilling over into the Tragic Week events, that took place from late July to early August, most acrimoniously in Barcelona, where protests intertwined with outbursts of anticlerical violence, forcing the Maura government to suspend Constitutional guarantees in the whole country after 28 July.
Spanish troops were shot at by francs-tireurs and skirmishes occurred near Melilla. General Marina decided to post six companies at Ait Aixa, under command of Colonel Álvarez Cabrera. They left Melilla at nightfall but got lost and, in the morning, found themselves in the Alfer Canyon, where they were decimated by gunfire from the heights. Colonel Cabrera and 26 men were killed, and 230 were wounded.
On 27 July the Spanish suffered a second defeat (known in Spain as the Desastre del Barranco del Lobo [es]: “Disaster of the Wolf Ravine”). The day before Marina had determined to send forces to protect the Segunda Caseta and also ordered General Pintos [es] to watch out the vicinity of the Mount Gurugu [es] at the helm of a brigade of jägers. The Riffians ambushed the later party and inflicted about 600 wounded and 150 killed Spanish soldiers (although the numbers are subject to dispute), including Pintos, who perished in action.
After this disaster, the Spanish paused its military operations. They raised troop-levels to 35,000 men and brought heavy artillery over from Spain. By the end of August the Spanish were ready and they launched a new attack. By January 1910 their overwhelming strength had enabled them to subdue most of the eastern tribes. The Spanish continued to expand their Melilla enclave to encompass the area from Cape Tres Forcas to the southern inlets of Mar Chica. However, this was achieved at the cost of 2,517 casualties.