In 1921, as a byproduct of their efforts to destroy the power of a local brigand, Raisuli, Spanish troops approached the unoccupied areas of the Rif. Abd-el-Krim sent their commander, General Manuel Fernández Silvestre, a warning that if the troops crossed the Ameqqran River, he would consider it as an act of war. Silvestre is said to have laughed and, shortly afterwards, crossed the river with 60,000 men and set up a military post in the foothills of Abarran mountains. In June 1921 a sizable Riffian force attacked this post killing 179 of the estimated 250 Spanish troops there. Soon afterwards, Abd el-Krim directed his forces to attack the Spanish lines at Anwal, which they did with great success. During the attack, General Silvestre, head of the Spanish forces, committed suicide when he saw that defeat was inevitable. In three weeks of fierce battles, 18,000 Spanish troops were killed. The Rifians' colossal victory established Abd el-Krim as a master and pioneer of guerrilla warfare, and the president of the Republic of the Rif. By July, the remainder of the 60,000 Spanish soldiers who were not killed or captured had fled to the coast, and into Melilla, defeated by an army of 30,000 Rifian fighters.