Ali was born in Cairo on 18 September 1921.[1] He attended medical school, but did not finish it and joined military academy.[1] He was commissioned as a combat engineering officer in 1942, and served as a sapper and pioneer commander with the British Army during the World War II.

He was involved in the 1948 Arab–Israeli War and as Engineer-in-Chief the Yom Kippur War. Between 1973 and 1975, he was commander of the Central Military Zone. He was head of the Egyptian Intelligence Service from 1975 to 1978.[1] After that, he served as minister of defense and military production under presidentAnwar Sadat.[2] Ali also played a role in peace negotiations between Egypt and Israel, resulting in a treaty in 1979. From 1980 to 1984, he was the deputy prime minister and foreign secretary.[1]