Francisco was to follow his father into the Navy, but as a result of the Spanish-American War the country lost much of its navy as well as most of its colonies. Not needing any more officers, entry to the Naval Academy was closed from 1906 to 1913. To his father's chagrin, Francisco decided to try the Spanish Army. In 1907, he entered the Infantry Academy in Toledo, graduating in 1910 as a lieutenant. Two years later, he obtained a commission to Morocco. Spanish efforts to occupy their new African protectorate provoked the protracted Rif War with native Moroccans.
Their tactics resulted in heavy losses among Spanish military officers, but they also provided an opportunity to earn promotion through merit. It was said that officers would receive either la caja o la faja. Franco quickly gained a reputation as a good officer. He served in the newly formed regulares, colonials with Spanish officers, who acted as shock troops.
In 1916, age 23 and already a captain, he was badly wounded in a skirmish at El Biutz and possibly lost a testicle. His survival marked him permanently in the eyes of the native troops as a man of baraka. He was recommended for Spain's highest honor for gallantry, the coveted Cruz Laureada de San Fernando, but instead was promoted to major in the Spanish Army. From 1917 to 1920, he served in Spain. In 1920, Lieutenant Colonel José Millán Astray, a histrionic but charismatic officer, founded the Spanish Foreign Legion, on similar lines to the French Foreign Legion. Franco became the Legion's second-in-command and returned to Africa.
On 24 July 1921, the poorly commanded and overextended Spanish Army suffered a crushing defeat at Annual from Rif tribesmen led by the Abd el-Krim brothers. The Legion symbolically saved the Spanish enclave of Melilla after a three-day forced march led by Franco. In 1923, by now a lieutenant colonel, he was made commander of the Legion.
That year, he married María del Carmen Polo y Martínez-Valdès. Three years later the couple had a daughter, María del Carmen. As a special mark of honor, his best man at the wedding was King Alfonso XIII, a fact that would mark him during the Republic as a monarchical officer. Promoted to colonel, Franco led the first wave of troops ashore at Al Hoceima in 1925. This landing in the heartland of Abd el-Krim's tribe, combined with the French invasion from the south, spelled the beginning of the end for the short-lived Republic of the Rif.
Becoming the youngest general in Spain in 1926, Franco was appointed in 1928 director of the newly created General Military Academy of Zaragoza, a new college for all Army cadets, replacing the former separate institutions for young men seeking to become officers in infantry, cavalry, artillery, and other branches of the army..