The spontaneous formation of particle pairs is one of the most intriguing phenomena in nature. A canonical example is when the potential energy between two elementary particles increases with their separation, as if the particles were confined to one another by a tense string. When the separation exceeds a critical value, new particle pairs can form, which causes the string to break. String-breaking dynamics in quantum chromodynamics, the theory of the strong force, play a fundamental role in high-energy particle collisions and the evolution of matter in the early universe. Simulating the evolution of strings and the formation of composite particles, or hadrons, is a grand challenge of modern physics. Quantum simulators are well suited to study dynamical processes. They are, therefore, expected to provide an edge over conventional methods based on classical computing. However, the experimental capabilities required to simulate the string-breaking phenomenon have not yet been demonstrated, even for simpler prototypical models of the strong force. In this work, we probe, for the first time on a quantum simulator, the spatiotemporally-resolved dynamics of string breaking in a (1+1)-dimensional Z2 lattice gauge theory, a theory that also exhibits confinement of charges. We employ a fully programmable trapped-ion quantum simulator, and emulate the effects of external static charges and strings via site-dependent control of magnetic fields, using a dual array of tightly focused laser beams targeting individual ions. First, we study the effect of confinement on the evolution of isolated charges. We find that these charges freely spread in the absence of string tension, but exhibit localized coherent oscillations as the string tension is increased. Then, we observe and characterize the breaking dynamics of a string initially stretched between two static charges, following an abrupt increase of the string tension. We find that charge pairs appear near the string edges and then spread out into the bulk, thereby identifying a route to dynamical string breaking that is distinct from the conventional Schwinger mechanism. This work, therefore, demonstrates that analog quantum simulators have achieved the control needed to uncover features of string-breaking dynamics, which may ultimately be relevant to nuclear and high-energy physics.