In the Variscan fold belt of Morocco, the Jebilet massif is characterized by Palaeozoic metasedimentary rocks intruded by syntectonic magmatism that includes an ultramafic–granitoid bimodal association and peraluminous granodiorites emplaced c. 330 Ma, intruded by younger leucogranites c. 300 Ma. The mafic–ultramafic rocks belong to a tholeiitic series, and display chemical and isotopic signatures consistent with mixing between mantle-derived and crust-derived magmas or assimilation and fractional crystallization. The granites within the bimodal association are mainly metaluminous to weakly peraluminous microgranites that show characteristics of A2-type granites. The peraluminous, calc-alkaline series consists mainly of cordierite-bearing granodiorites enclosing magmatic microgranular enclaves and pelitic xenoliths. Detailed element and isotope data suggest that the alkaline and the peraluminous granitoids were formed in the shallow crust (<30 km) by partial melting of tonalitic sources at high temperatures (up to 900°C) and by partial melting of metasedimentary protoliths at relatively low temperatures (c. 750°C), respectively. Mixing between the coeval mantle-derived and crust-derived magmas contributed to the large variation of initial εNd values and initial Sr isotopic ratios observed in the granitoids. Further contamination occurred by wall-rock assimilation during ascent of the granodioritic plutons to the upper crust. The ultramafic–granitoid association has been intruded by leucogranites that have high initial Sr isotopic ratios and low initial εNd values, indicating a purely crustal origin. The heating events that caused emplacement of the Jebilet magmatism are related to cessation of continental subduction and convective erosion/thinning of the lithospheric mantle during plate convergence.