Seven of the nine known Mars Trojan asteroids belong to an orbital cluster1,2 named after its largest member, (5261) Eureka. Eureka is probably the progenitor of the whole cluster, which formed at least 1 Gyr ago3. It has been suggested3 that the thermal YORP (Yarkovsky-O'Keefe-Radzievskii-Paddack) effect spun up Eureka, resulting in fragments being ejected by the rotational-fission mechanism. Eureka's spectrum exhibits a broad and deep absorption band around 1 μm, indicating an olivine-rich composition4. Here we show evidence that the Trojan Eureka cluster progenitor could have originated as impact debris excavated from the Martian mantle. We present new near-infrared observations of two Trojans ((311999) 2007 NS2 and (385250) 2001 DH47) and find that both exhibit an olivine-rich reflectance spectrum similar to Eureka's. These measurements confirm that the progenitor of the cluster has an achondritic composition4. Olivine-rich reflectance spectra are rare amongst asteroids5 but are seen around the largest basins on Mars6. They are also consistent with some Martian meteorites (for example, Chassigny7) and with the material comprising much of the Martian mantle8,9. Using numerical simulations, we show that the Mars Trojans are more likely to be impact ejecta from Mars than captured olivine-rich asteroids transported from the main belt. This result directly links specific asteroids to debris from the forming planets.