The Mesozoic was the geological era in which dinosaurs lived, as well as the first birds and mammals. It lasted about 186 million years, starting 252.2 mya (million years ago) with the P/Tr extinction and ending 66 mya with the K/T extinction (the one that killed dinosaurs).