He was 87.
El-Shafie, born in the Nile Delta city of Tanta in 1918, died on Friday morning at his home after a long illness, his nephew Nadia el-Shafie told The Associated Press.
El-Shafie was an officer in the Egyptian military during the 1948 war between the Arabs and Israel, and like many returned disillusioned with Egypt's King Farouq after the Arabs' losses.
He joined Gamal Abdel Nasser in the Free Officers Movement, a group of military officers who toppled the king in 1952. Abdel Nasser, who became president, elevated el-Shafie to war minister in 1954. He led the court that tried members of the Muslim Brotherhood after an alleged assassination attempt against Abdel Nasser that same year.
Abdel Nasser's successor Anwar al-Sadat named el-Shafie vice-president in 1970 but removed him five years later after el-Shafie opposed Sadat's policies towards Israel.
Anwar al-Sadat replaced el-Shafie
with Hosni Mubarak
El-Shafie sharply opposed al-Sadat's 1979 peace deal with Israel.
Al-Sadat replaced el-Shafie as vice-president with Hosni Mubarak, who rose to the presidency after al-Sadat's assassination in 1981.
El-Shafie's funeral will be on Saturday.