Gaining commission as a Second Lieutenant in the British Indian Army, Khan served with distinction in the Burma and North African campaigns as part of the Allied effort in World War II. Following the Partition of India in 1947, he opted for the Dominion of Pakistan, subsequently transferring his military service to the newly-created Pakistan Army. He led forward combat brigades against India during the First Kashmir War in 1947–1948, and eventually ascended the ranks to become C-in-C after the Pakistani military imposed martial law in the country following the 1958 coup d'état. Khan gained notability and public fame throughout Pakistan when he was in command of the Pakistan Army during the Second Kashmir War with India in 1965.