Superconductivity originates from the formation of bound (Cooper) pairs of electrons that can move through the lattice without resistance below the superconducting transition temperature Tc (ref. 1). Electron Cooper pairs in most superconductors form anti-parallel spin singlets with total spin S = 0 (ref. 2), although they can also form parallel spin-triplet Cooper pairs with S = 1 and an odd parity wavefunction3. Spin-triplet pairing is important because it can host topological states and Majorana fermions relevant for quantum computation4,5. Because spin-triplet pairing is usually mediated by ferromagnetic (FM) spin fluctuations3, uranium-based materials near an FM instability are considered to be ideal candidates for realizing spin-triplet superconductivity6. Indeed, UTe2, which has a Tc ≈ 1.6 K (refs. 7,8), has been identified as a candidate for a chiral spin-triplet topological superconductor near an FM instability7,8,9,10,11,12,13,14, although it also has antiferromagnetic (AF) spin fluctuations15,16. Here we use inelastic neutron scattering (INS) to show that superconductivity in UTe2 is coupled to a sharp magnetic excitation, termed resonance17,18,19,20,21,22,23, at the Brillouin zone boundary near AF order. Because the resonance has only been found in spin-singlet unconventional superconductors near an AF instability17,18,19,20,21,22,23, its observation in UTe2 suggests that AF spin fluctuations may also induce spin-triplet pairing24 or that electron pairing in UTe2 has a spin-singlet component.