The fossil of the amphibious Phiomicetus anubis was originally discovered in Egypt's Western Desert, it was once covered by sea and now is a rich source of fossils.
The partial skeleton was analysed by scientists at Mansoura University.
Its skull resembles that of Anubis, the ancient Egyptian jackal-headed god of the dead after which it was named.
The ancestors of modern whales developed from deer-like mammals that lived on land over the course of 10 million years.
While this is not the first time the fossil of a whale with legs has been found, the Phiomicetus anubis is believed to be the earliest type of semi-aquatic whale to be discovered in Africa.
Weighing an estimated 600kg and three metres (10ft) in length, the Phiomicetus anubis had strong jaws to catch prey, according to the study published by the Proceedings of the Royal Society B on Wednesday. The whale was able to walk on land and swim in water.