The identification of galaxies at extreme distances provides the most direct information about the earliest phases of galaxy formation. But at redshifts z > 5 even the most luminous galaxies appear faint; the interpretation of low signal-to-noise ratio data is difficult and misidentifications do occur. Here we report optical and near-infrared observations of the source STIS123627+621755, which was previously suggested to be at a redshift of 6.68 (ref. 1). At that redshift, and with the reported spectral energy distribution, the galaxy should be essentially invisible at wavelengths less than 9,300Å, because the intervening intergalactic medium absorbs almost all light energetic enough to ionize neutral hydrogen-that is, with wavelengths less than the redshifted Lyman limit of λ = (1 + z ) × 912Å. At near-infrared wavelengths, however, the galaxy should be relatively bright. Here we report a detection of the galaxy at 6,700Å and a non-detection at a wavelength of 1.2μm, contrary to expectations for z ~ 6.68. The data conservatively require that STIS123627+621755 has a redshift z < 6.