In the mid Paleozoic era (between 360 and 290 mya), an initial substratum of ancient granites and sediments started bending and metamorphizing, forming gneiss. Thereafter, approximately 290 and 250 mya during the Carboniferous period, the gneiss fractured, allowed a mass of magma to reach the surface which ultimately hardened into a granite shelf tableland. In the final phase of the Paleozoic era, during the Permian period, the tectonic plate collision causing the whole mountain range to rise. Finally, during the end of the Paleozoic through the Mesozoic era (between 250 and 65 mya) and up to the present, ongoing erosion processes reduced the size and smoothed and rounded the profile of the mountains of the Guadarramas.