Did a dinosaur live first or a lizard?

Dinosaurs emerged some time before the first true lizards, though there were reptiles that resembled lizards long before the dinosaurs.