  We demonstrate that the steep decay and long plateau in the early phases of
gamma ray burst (GRB) X-ray afterglows are naturally produced in the collapsar
model, by a means ultimately related to the dynamics of relativistic jet
propagation through a massive star. We present two-dimensional axisymmetric
hydrodynamical simulations which start from a collapsar engine and evolve all
the way through the late afterglow phase. The resultant outflow includes a jet
core which is highly relativistic after breaking out of the star, but becomes
baryon-loaded after colliding with a massive outer shell, corresponding to mass
from the stellar atmosphere of the progenitor star which became trapped in
front of the jet core at breakout. The prompt emission produced before or
during this collision would then have the signature of a high Lorentz factor
jet, but the afterglow is produced by the amalgamated post-collision ejecta
which has more inertia than the original highly relativistic jet core and thus
has a delayed deceleration. This naturally explains the early light curve
behavior discovered by Swift, including a steep decay and a long plateau,
without invoking late-time energy injection from the central engine. The
numerical simulation is performed continuously from engine to afterglow,
covering a dynamic range of over ten orders of magnitude in radius. Light
curves calculated from the numerical output demonstrate that this mechanism
reproduces basic features seen in early afterglow data. Initial steep decays
are produced by internal shocks, and the plateau corresponds to the coasting
phase of the outflow.
