* Igneous rocks form from the cooling and solidification of magma (molten rock below the surface) or lava (molten rock above the surface).
* Intrusive igneous rocks form when magma cools and crystallizes beneath the Earth's surface. Examples include granite and gabbro.
* Extrusive igneous rocks form when lava erupts onto the surface and cools. Examples include basalt and rhyolite.
Let's look at why the other rock types don't fit the description:
* Sedimentary rocks form from the accumulation and cementation of sediments (pieces of other rocks, minerals, or organic matter) at the Earth's surface.
* Metamorphic rocks form when existing rocks (igneous, sedimentary, or even other metamorphic rocks) are transformed by heat, pressure, and/or chemical reactions, usually deep within the Earth's crust.
Therefore, only igneous rocks can form both deep below the surface and above the surface.