Neutron stars and stellar-mass black holes are the remnants of massive star explosions. Most massive stars reside in close binary systems, and the interplay between the companion star and the newly formed compact object has been theoretically explored, but signatures for binarity or evidence for the formation of a compact object during a supernova explosion are still lacking. Here we report a stripped-envelope supernova, SN 2022jli, which shows 12.4-day periodic undulations during the declining light curve. Narrow Hα emission is detected in late-time spectra with concordant periodic velocity shifts, likely arising from hydrogen gas stripped from a companion and accreted onto the compact remnant. A new Fermi/LAT γ-ray source is temporally and positionally consistent with SN 2022jli. The observed properties of SN 2022jli, including periodic undulations in the optical light curve, coherent Hα emission shifting, and evidence for association with a γ-ray source, point to the explosion of a massive star in a binary system leaving behind a bound compact remnant. Mass accretion from the companion star onto the compact object powers the light curve of the supernova and generates the γ-ray emission.