  We explore high-redshift gamma-ray bursts (GRBs) as promising tools to probe
pre-galactic metal enrichment. We utilize the bright afterglow of a Pop III GRB
exploding in a primordial dwarf galaxy as a luminous background source, and
calculate the strength of metal absorption lines that are imprinted by the
first heavy elements in the intergalactic medium (IGM). To derive the GRB
absorption line diagnostics, we use an existing highly-resolved simulation of
the formation of a first galaxy which is characterized by the onset of atomic
hydrogen cooling in a halo with virial temperature >10^4 K. We explore the
unusual circumburst environment inside the systems that hosted Pop III stars,
modeling the density evolution with the self-similar solution for a champagne
flow. For minihalos close to the cooling threshold, the circumburst density is
roughly proportional to (1+z) with values of about a few cm^{-3}. In more
massive halos, corresponding to the first galaxies, the density may be larger,
n>100 cm^{-3}. The resulting afterglow fluxes may be detectable with the JWST
and VLA in the near-IR and radio wavebands, respectively, out to redshift z>20.
We predict that the maximum of the afterglow emission shifts from near-IR to
millimeter bands with peak fluxes from mJy to Jy at different observed times.
GRBs are ideal tools for probing the metal enrichment in the early IGM, due to
their high luminosities and featureless power-law spectra. The metals in the
first galaxies produced by the first supernova (SN) explosions are likely to
reside in low-ionization stages. We show that if the afterglow can be observed
sufficiently early, analysis of the metal lines can distinguish whether the
first heavy elements were produced in a PISN, or a core-collapse (Type II) SN,
thus constraining the initial mass function of the first stars.
