Cosmic rays are atomic nuclei arriving from outer space that reach the highest energies observed in nature. Clues to their origin come from studying the distribution of their arrival directions. Using 3 × 104 cosmic rays with energies above 8 × 1018 electron volts, recorded with the Pierre Auger Observatory from a total exposure of 76,800 km2 sr year, we determined the existence of anisotropy in arrival directions. The anisotropy, detected at more than a 5.2σ level of significance, can be described by a dipole with an amplitude of percent toward right ascension αd = 100 ± 10 degrees and declination δd = degrees. That direction indicates an extragalactic origin for these ultrahigh-energy particles.