Igneous rock
Igneous rock is one of the three main rock
Rock (geology)
In geology, rock or stone is a naturally occurring solid aggregate of minerals and/or mineraloids.The Earth's outer solid layer, the lithosphere, is made of rock. In general rocks are of three types, namely, igneous, sedimentary, and metamorphic...

 types, the others being sedimentary
Sedimentary rock
Sedimentary rock are types of rock that are formed by the deposition of material at the Earth's surface and within bodies of water. Sedimentation is the collective name for processes that cause mineral and/or organic particles to settle and accumulate or minerals to precipitate from a solution....

 and metamorphic rock
Metamorphic rock
Metamorphic rock is the transformation of an existing rock type, the protolith, in a process called metamorphism, which means "change in form". The protolith is subjected to heat and pressure causing profound physical and/or chemical change...

. Igneous rock is formed through the cooling and solidification
Freezing or solidification is a phase change in which a liquid turns into a solid when its temperature is lowered below its freezing point. The reverse process is melting....

 of magma
Magma is a mixture of molten rock, volatiles and solids that is found beneath the surface of the Earth, and is expected to exist on other terrestrial planets. Besides molten rock, magma may also contain suspended crystals and dissolved gas and sometimes also gas bubbles. Magma often collects in...

 or lava
Lava refers both to molten rock expelled by a volcano during an eruption and the resulting rock after solidification and cooling. This molten rock is formed in the interior of some planets, including Earth, and some of their satellites. When first erupted from a volcanic vent, lava is a liquid at...

. Igneous rock may form with or without crystallization
Crystallization is the process of formation of solid crystals precipitating from a solution, melt or more rarely deposited directly from a gas. Crystallization is also a chemical solid–liquid separation technique, in which mass transfer of a solute from the liquid solution to a pure solid...

, either below the surface as intrusive
An intrusion is liquid rock that forms under Earth's surface. Magma from under the surface is slowly pushed up from deep within the earth into any cracks or spaces it can find, sometimes pushing existing country rock out of the way, a process that can take millions of years. As the rock slowly...

 (plutonic) rocks or on the surface as extrusive
Extrusive (geology)
Extrusive refers to the mode of igneous volcanic rock formation in which hot magma from inside the Earth flows out onto the surface as lava or explodes violently into the atmosphere to fall back as pyroclastics or tuff...

Volcanic rock
Volcanic rock is a rock formed from magma erupted from a volcano. In other words, it is an igneous rock of volcanic origin...

) rocks. This magma can be derived from partial melts of pre-existing rocks in either a planet
A planet is a celestial body orbiting a star or stellar remnant that is massive enough to be rounded by its own gravity, is not massive enough to cause thermonuclear fusion, and has cleared its neighbouring region of planetesimals.The term planet is ancient, with ties to history, science,...

's mantle
Mantle (geology)
The mantle is a part of a terrestrial planet or other rocky body large enough to have differentiation by density. The interior of the Earth, similar to the other terrestrial planets, is chemically divided into layers. The mantle is a highly viscous layer between the crust and the outer core....

 or crust
Crust (geology)
In geology, the crust is the outermost solid shell of a rocky planet or natural satellite, which is chemically distinct from the underlying mantle...

. Typically, the melting is caused by one or more of three processes: an increase in temperature, a decrease in pressure, or a change in composition.