When Gene Hackman started having back pain, the movie's insurance company refused to allow shooting to continue because a permanent injury to Hackman could have cost it a lot of money. The insurers suggested shooting the movie in the United States, but sand dunes in Nevada were not the same color as sand dunes in Agadir. Several big American transport planes were used to transport tons of sand from the Agadir dunes in to camouflage the sand of Nevada. (Source: Beyond Casablanca, Page 131).
This movie was filmed in Spain at the same time Marty Feldman was making The Last Remake of Beau Geste (1977). The productions for both movies fought over the supply of horses, camels, costumes, and shooting locations. Some extras appeared in the wrong movie on one occasion.
El Krim was based on the Moroccan revolutionary Abd el-Krim (1882-1963), leader of a large-scale armed resistance movement in the Rif, a Berber area of northeastern Morocco. He became the first president of Rif Republic (1921-26).
Both Vietcong leader Ho Chí Minh and Zedong Mao referred to Abd el-Krim as their predecessor. The Committee of Union and Progress in Turkey, led by Mustafa Kemal Atatürk, held Abd el-Krim in high esteem.