Galactic cosmic rays consist of protons, electrons and ions, most of which are believed to be accelerated to relativistic speeds in supernova remnants. All components of the cosmic rays show an intensity that decreases as a power law with increasing energy (for example as E(-2.7)). Electrons in particular lose energy rapidly through synchrotron and inverse Compton processes, resulting in a relatively short lifetime (about 10(5) years) and a rapidly falling intensity, which raises the possibility of seeing the contribution from individual nearby sources (less than one kiloparsec away). Here we report an excess of galactic cosmic-ray electrons at energies of approximately 300-800 GeV, which indicates a nearby source of energetic electrons. Such a source could be an unseen astrophysical object (such as a pulsar or micro-quasar) that accelerates electrons to those energies, or the electrons could arise from the annihilation of dark matter particles (such as a Kaluza-Klein particle with a mass of about 620 GeV).