It was originally a Western story by James Warner Bellah and Willis Goldbeck which concerned conflict between the US cavalry and Apaches. Producer Harold Hecht and star Burt Lancaster then decided that "John Ford and other Hollywood operators have so effectively decimated the Apache population" that they hired writer A.I. Bezzerides to reimagine the story with a Foreign Legion setting which wound up involving the Rif War (1911-1927). Roland Kibbee and Frank Davis were hired to rewrite the script to make it more comedic.