Abstract:
Gamma-ray bursts (GRBs) are flashes of high-energy radiation arising from energetic cosmic explosions. Bursts of long (greater than two seconds) duration are produced by the core-collapse of massive stars1, and those of short (less than two seconds) duration by the merger of compact objects, such as two neutron stars2. A third class of events with hybrid high-energy properties was identified3, but never conclusively linked to a stellar progenitor. The lack of bright supernovae rules out typical core-collapse explosions4,5,6, but their distance scales prevent sensitive searches for direct signatures of a progenitor system. Only tentative evidence for a kilonova has been presented7,8. Here we report observations of the exceptionally bright GRB 211211A, which classify it as a hybrid event and constrain its distance scale to only 346 megaparsecs. Our measurements indicate that its lower-energy (from ultraviolet to near-infrared) counterpart is powered by a luminous (approximately 1042 erg per second) kilonova possibly formed in the ejecta of a compact object merger.