Direct analysis of the composition of Mars is possible through delivery of meteorites to Earth. Martian meteorites include ∼165 to 2400 Ma shergottites, originating from depleted to enriched mantle sources, and ∼1340 Ma nakhlites and chassignites, formed by low degree partial melting of a depleted mantle source. To date, no unified model has been proposed to explain the petrogenesis of these distinct rock types, despite their importance for understanding the formation and evolution of Mars. Here we report a coherent geochemical dataset for shergottites, nakhlites and chassignites revealing fundamental differences in sources. Shergottites have lower Nb/Y at a given Zr/Y than nakhlites or chassignites, a relationship nearly identical to terrestrial Hawaiian main shield and rejuvenated volcanism. Nakhlite and chassignite compositions are consistent with melting of hydrated and metasomatized depleted mantle lithosphere, whereas shergottite melts originate from deep mantle sources. Generation of martian magmas can be explained by temporally distinct melting episodes within and below dynamically supported and variably metasomatized lithosphere, by long-lived, static mantle plumes.