Mammals evolved from cynodonts, a group of superficially dog-like mammal-like reptiles in the wake of the Permian-Triassic mass extinction.
Only with the massive extinction at the end of the Cretaceous did the dinosaurs leave the stage open for the establishment of a new fauna of mammals.