  Data from the Swift satellite has enabled us for the first time to provide a
complete picture of the gamma-ray burst emission mechanism and its relationship
with the early afterglow emissions. We show that gamma-ray photons for two
bursts, 050126 & 050219A, for which we have carried out detailed analysis were
produced as a result of the synchrotron self-Compton process in the material
ejected in the explosion when it was heated to a mildly relativistic
temperature at a distance from the center of explosion of order the
deceleration radius. Both of these bursts exhibit rapidly declining early X-ray
afterglow lightcurves; this emission is from the same source that produced the
gamma-ray burst. The technique we exploit to determine this is very general and
makes no assumption about any particular model for gamma-ray generation except
that the basic radiation mechanism is some combination of synchrotron and
inverse-Compton processes in a relativistic outflow. For GRB 050219A we can
rule out the possibility that energy from the explosion is carried outward by
magnetic fields, and that the dissipation of this field produced the
$\gamma$-ray burst.
