Jupiter’s rapidly rotating, strong magnetic field provides a natural laboratory that is key to understanding the dynamics of high-energy plasmas. Spectacular auroral x-ray flares are diagnostic of the most energetic processes governing magnetospheres but seemingly unique to Jupiter. Since their discovery 40 years ago, the processes that produce Jupiter’s x-ray flares have remained unknown. Here, we report simultaneous in situ satellite and space-based telescope observations that reveal the processes that produce Jupiter’s x-ray flares, showing surprising similarities to terrestrial ion aurora. Planetary-scale electromagnetic waves are observed to modulate electromagnetic ion cyclotron waves, periodically causing heavy ions to precipitate and produce Jupiter’s x-ray pulses. Our findings show that ion aurorae share common mechanisms across planetary systems, despite temporal, spatial, and energetic scales varying by orders of magnitude.