Rocks are naturally occurring solids composed of two or more minerals. There are three main types of rocks: igneous, sedimentary, and metamorphic. Igneous rocks form from cooling magma underground or lava on the surface. Sedimentary rocks form from compressed sediments and often contain fossils. Metamorphic rocks were originally igneous or sedimentary rocks but were changed by heat and pressure in the Earth's crust. Rocks are constantly changing from one type to another through the rock cycle over millions of years.