This article is from the Dolphin
FAQ, by Jaap van der Toorn
The earliest recognizable cetaceans lived about 50 million years ago. These evolved from the Mesonychids: large land mammals, some of which were carnivorous, some herbivorous. The earliest cetaceans were members of the now extinct family Archaeoceti (the best known of which are Zeuglodon and Basilosaurus). 38-25 million years ago the Archaeoceti disappeared and were replaced by the early Odontocetes (toothed whales) and Mysticetes (baleen whales). The earliest dolphins appeared in the late Miocene period, some 11 million years ago.
The land animals that are closest to whales and dolphins are the Ungulates (hoofed animals). This was determined among others by comparing the structure of body proteins. The closest relative is probably the hippopotamus (Ursing and Arnason, 1998).
P.G.H.Evans (1987) The Natural History of Whales and Dolphins. Christoper Helm Publishers, London.
B.M. Ursing & U. Arnason (1998) Analyses of mitochondrial genomes strongly support a hippopotamus-whale clade Proceedings of the Royal Society of London B 265: 2251-2255