The optical light that is generated simultaneously with the x-rays and gamma-rays during a gamma-ray burst (GRB) provides clues about the nature of the explosions that occur as massive stars collapse to form black holes. We report on the bright optical flash and fading afterglow from the powerful burst GRB 130427A and present a comparison with the properties of the gamma-ray emission that show correlation of the optical and >100 MeV photon flux light curves during the first 7,000 seconds. We attribute this correlation to co-generation in an external shock. The simultaneous, multi-color, optical observations are best explained at early times by reverse shock emission generated in the relativistic burst ejecta as it collides with surrounding material and at late times by a forward shock traversing the circumburst environment. The link between optical afterglow and >100 MeV emission suggests that nearby early peaked afterglows will be the best candidates for studying GRB emission at GeV/TeV energies.