The Hubble Deep Field (HDF) is a region in the sky that provides one of the deepest multi-wavelength views of the distant universe and has led to the detection of thousands of galaxies seen throughout cosmic time. An early map of the HDF at a wavelength of 850 microns that is sensitive to dust emission powered by star formation revealed the brightest source in the field, dubbed HDF850.1. For more than a decade, this source remained elusive and, despite significant efforts, no counterpart at shorter wavelengths, and thus no redshift, size or mass, could be identified. Here we report, using a millimeter wave molecular line scan, an unambiguous redshift determination for HDF850.1 of z=5.183. This places HDF850.1 in a galaxy overdensity at z~5.2 in the HDF, corresponding to a cosmic age of only 1.1 Gyr after the Big Bang. This redshift is significantly higher than earlier estimates and higher than most of the >100 sub-millimeter bright galaxies identified to date. The source has a star formation rate of 850 M_sun/yr and is spatially resolved on scales of 5 kpc, with an implied dynamical mass of ~1.3x10^11 M_sun, a significant fraction of which is present in the form of molecular gas. Despite our accurate redshift and position, a counterpart arising from starlight remains elusive.