The Earth formed 4.54 billion years ago from a solar nebula. Its early atmosphere was toxic and volcanic activity and asteroid impacts were common. One large impact is believed to have formed the Moon. Over billions of years the planet cooled and developed tectonic plates and a stable crust allowing liquid water and the first life. The atmosphere gradually gained oxygen as photosynthetic life evolved. Multicellular life diversified in the Phanerozoic Eon starting over 500 million years ago, though many species died out in extinction events like the one that ended the Cretaceous Period.