Classical electromagnetism and quantum mechanics are both central to the modern understanding of the physical world and its ongoing technological development. Quantum simulations of electromagnetic forces have the potential to provide information about materials and systems that do not have conveniently solvable theoretical descriptions, such as those related to quantum Hall physics, or that have not been physically observed, such as magnetic monopoles. However, quantum simulations that simultaneously implement all of the principal features of classical electromagnetism have thus far proved elusive. We experimentally realize a simulation in which a charged quantum particle interacts with the knotted electromagnetic fields peculiar to a topological model of ball lightning. These phenomena are induced by precise spatiotemporal control of the spin field of an atomic Bose-Einstein condensate, simultaneously creating a Shankar skyrmion—a topological excitation that was theoretically predicted four decades ago but never before observed experimentally. Our results reveal the versatile capabilities of synthetic electromagnetism and provide the first experimental images of topological three-dimensional skyrmions in a quantum system.