Ultrahot giant exoplanets receive thousands of times Earth’s insolation. Their high-temperature atmospheres (greater than 2,000 kelvin) are ideal laboratories for studying extreme planetary climates and chemistry. Daysides are predicted to be cloud-free, dominated by atomic species and much hotter than nightside. Atoms are expected to recombine into molecules over the nightside, resulting in different day and night chemistries. Although metallic elements and a large temperature contrast have been observed, no chemical gradient has been measured across the surface of such an exoplanet. Different atmospheric chemistry between the day-to-night (‘evening’) and night-to-day (‘morning’) terminators could, however, be revealed as an asymmetric absorption signature during transit. Here we report the detection of an asymmetric atmospheric signature in the ultrahot exoplanet WASP-76b. We spectrally and temporally resolve this signature using a combination of high-dispersion spectroscopy with a large photon-collecting area. The absorption signal, attributed to neutral iron, is blueshifted by −11 ± 0.7 kilometres per second on the trailing limb, which can be explained by a combination of planetary rotation and wind blowing from the hot dayside. In contrast, no signal arises from the nightside close to the morning terminator, showing that atomic iron is not absorbing starlight there. We conclude that iron must therefore condense during its journey across the nightside.