  We show that the light curve of the double GeV+optical flash in GRB 130427A
is consistent with radiation from the blast wave in a wind-type medium with
density parameter $A=\rho r^2\sim 5\times 10^{10}$ g cm$^{-1}$. The peak of the
flash is emitted by copious $e^\pm$ pairs created and heated in the blast wave;
our first-principle calculation determines the pair-loading factor and
temperature of the shocked plasma. Using detailed radiative transfer
simulations we reconstruct the observed double flash. The optical flash is
dominated by synchrotron emission from the thermal plasma behind the forward
shock, and the GeV flash is produced via inverse Compton (IC) scattering by the
same plasma. The seed photons for IC scattering are dominated by the prompt MeV
radiation during the first tens of seconds, and by the optical to X-ray
afterglow thereafter. IC cooling of the thermal plasma behind the forward shock
reproduces all GeV data from a few seconds to $\sim 1$ day. We find that the
blast wave Lorentz factor at the peak of the flash is $\Gamma\approx 200$, and
the forward shock magnetization is $\epsilon_B\sim 2\times 10^{-4}$. An
additional source is required by the data in the optical and X-ray bands at
times $>10^2$ s; we speculate that this additional source may be a long-lived
reverse shock in the explosion ejecta.
