Metamorphic rock is igneous or sedimentary rock that has been heated and squeezed. It can erode into sediment or melt into magma. It is formed under extreme pressure and temperature deep inside mountain chains.