The earliest compounds forming Earth's first continental crust were magmatic rocks with tonalitic-trondhjemitic-granodioritic composition (TTGs). TTGs are widely seen as originating from melting of hydrated oceanic crust in subduction zones. Alternative models argue that they may have formed by melting within thickened mafic oceanic protocrust. To simulate formation of Eoarchean TTGs in different tectonic regimes, we combine for the first time the thermodynamic calculation of residual assemblages with subsequent modeling of trace element contents in TTGs. We compare water-absent partial melting of two hydrated starting compositions, a modern mid-oceanic-ridge basalt (MORB) and a typical Eoarchean arc tholeiite from the Isua Supracrustal Belt that represents the country rock of Earth's oldest TTGs in southern West Greenland. At 10 kbar, partial melting of MORB-like residues results in modeled TTG compositions that are very different from natural ones. Melting at higher pressures (14 and 18 kbar) leads to a better match, but several key trace element parameters in TTGs are still amiss. A perfect fit for trace element compositions is achieved by melting of Eoarchean arc tholeiites at 10 and 14 kbar. These protoliths contain less Al and Na and more Fe and Mg as compared to present-day MORB and form amphibole-rich and plagioclase-free residues even at low pressures. Formation of Earth's oldest continental crust is therefore best explained by melting within tectonically thickened mafic island-arc crust.