The measurement of an excess in the cosmic-ray electron spectrum between 300 and 800 GeV by the ATIC experiment has - together with the PAMELA detection of a rise in the positron fraction up to \approx 100 GeV - motivated many interpretations in terms of dark matter scenarios ; alternative explanations assume a nearby electron source like a pulsar or supernova remnant . Here we present a measurement of the cosmic-ray electron spectrum with H.E.S.S . starting at 340 GeV . While the overall electron flux measured by H.E.S.S . is consistent with the ATIC data within statistical and systematic errors , the H.E.S.S . data exclude a pronounced peak in the electron spectrum as suggested for interpretation by ATIC . The H.E.S.S . data follow a power-law spectrum with spectral index of 3.0 \pm 0.1 \mathrm { ( stat . ) } \pm 0.3 \mathrm { ( syst . ) } , which steepens at about 1 TeV .