Cetaceans, derived from the Latin word for whale, "cetus," is the mammalian order which includes whales, dolphins and porpoises. Cetaceans are one of four mammal groups adapted to aquatic life, the others being the sirenians (dugongs and manatees), pinnipeds (seals and walruses), and an aquatic subfamily of mustelids, the otters. Like other aquatic mammals, the cetaceans evolved from terrestrial ancestors.
For many years, it was a mystery how the cetaceans evolved to be what they are today. This lasted until the discovery of a group of terrestrial proto-whales, the pakicetids, in Pakistan in 1983. Pakicetids are the earliest known cetaceans, living during the early Eocene, about 53 million years ago. Their fossils were dug up in an area of Pakistan that was coastal to the ancient Tethys Sea, a body of water connected to the World Ocean and most directly analogous to the Indian Ocean of today.
Pakicetids are considered cetaceans because of three telltale features that only whales have: a specific positioning of ear bones within the skull, a folding in the bone of the middle ear, and the way cusps on the animal's molars are arranged. These characteristics may seem liwwke minutiae, but they prove that pakicetids were ancestral to whales. Carnivorous land animals, pakicetids more closely resembled wolves than anything we would recognize today as cetacean. Because their bones were found near what was once water, they are thought to have been at least semi-aquatic.
Some portion of pakicetids are thought to have evolved into ambulocetids ("walking whales"), best exemplified by a near-complete fossil skeleton of the species Ambulocetus natans, a remarkable 3 m (10 ft) long "mammalian crocodile", considered an excellent example of a "missing link" (transitional) fossil. Ambulocetids, also found in Pakistan, lived 50-49 million years ago. The animal was clearly heavily aquatic, although it had legs and could have supported its own weight on land. Analysis of teeth has shown it could live in both fresh and salt water environments, and it possessed special ear adaptations which would have allowed it to hear well underwater. Search for an image of ambulocetus and you'll see how odd it looked.
Around the same time period, the protocetids emerged. Procetids, meaning "early whales," were a complex, heterogeneous group. Fossils or fossil fragments of protocetids have been found in Asia, Europe, Africa, and North America. Protocetids were large, with stubby feet, and begun to look more like the cetaceans of today. Protocetus, one species, had a dolphin-like body. It is unknown whether this family had tail flukes like modern whales, as this part of the body is non-skeletal and does not fossilize well.
The first two groups of fully marine cetaceans were basilosaurids, including Basilosaurus — "King Lizard," mistaken for a reptile when it was discovered in 1840, hence the "saurus" in the name — and Dorudon. Skeletons of Basilosaurus, as long as 8m (60 feet), have always been considered fantastic. Their most famous feature are 0.6 meter (2 feet) long vestigal limbs. Basilosaurid fossils are dated to 40 to 34 million years ago, and have been found in Egypt, Pakistan, and the United States.
The basilosaurids eventually evolved into whales as we know them today.