  Observations of the afterglows of long gamma-ray bursts (GRBs) allow the
study of star-forming galaxies across most of cosmic history. Here we present
observations of GRB 111008A from which we can measure metallicity, chemical
abundance patterns, dust-to-metals ratio and extinction of the GRB host galaxy
at z=5.0. The host absorption system is a damped Lyman-alpha absorber (DLA)
with a very large neutral hydrogen column density of log N(HI)/cm^(-2) = 22.30
+/- 0.06, and a metallicity of [S/H]= -1.70 +/- 0.10. It is the highest
redshift GRB with such a precise metallicity measurement. The presence of
fine-structure lines confirms the z=5.0 system as the GRB host galaxy, and
makes this the highest redshift where Fe II fine-structure lines have been
detected. The afterglow is mildly reddened with A_V = 0.11 +/- 0.04 mag, and
the host galaxy has a dust-to-metals ratio which is consistent with being equal
to or lower than typical values in the Local Group.
