Extremely hot liquid and semi-liquid rock located under Earth's surface; when magma flows onto Earth's surface, it is called lava.