 Whales are descendants of land @-@ dwelling mammals of the artiodactyl order ( even @-@ toed ungulates ) . They are related to the Indohyus , an extinct chevrotain @-@ like ungulate , from which they split approximately 48 million years ago . Primitive cetaceans , or archaeocetes , first took to the sea approximately 49 million years ago and became fully aquatic 5 – 10 million years later . What defines an archaeocete is the presence of anatomical features exclusive to cetaceans , alongside other primitive features not found in modern cetaceans , such as visible legs or asymmetrical teeth . Their features became adapted for living in the marine environment . Major anatomical changes included their hearing set @-@ up that channeled vibrations from the jaw to the earbone ( Ambulocetus 49 mya ) , a streamlined body and the growth of flukes on the tail ( Protocetus 43 mya ) , the migration of the nostrils toward the top of the cranium ( blowholes ) , and the modification of the forelimbs into flippers ( Basilosaurus 35 mya ) , and the shrinking and eventual disappearance of the hind limbs ( the first odontocetes and mysticetes 34 mya ) . 
