In a recent article we presented a model for hadronic rescattering, and some results were shown for $$\mathrm {p}\mathrm {p}$$
p
p
collisions at LHC energies. In order to extend the studies to $$\mathrm {p}\mathrm {A}$$
p
A
and $$\mathrm {A}\mathrm {A}$$
A
A
collisions, the Angantyr model for heavy-ion collisions is taken as the starting point. Both these models are implemented within the general-purpose Monte Carlo event generator Pythia, which makes the matching reasonably straightforward, and allows for detailed studies of the full space–time evolution. The rescattering rate is significantly higher than in $$\mathrm {p}\mathrm {p}$$
p
p
, especially for central $$\mathrm {A}\mathrm {A}$$
A
A
collisions, where the typical primary hadron rescatters several times. We study the impact of rescattering on a number of distributions, such as $$p_{\perp }$$
p
⊥
and $$\eta $$
η
spectra, and the space–time evolution of the whole collision process. Notably rescattering is shown to give a significant contribution to elliptic flow in $$\mathrm {XeXe}$$
XeXe
and $$\mathrm {PbPb}$$
PbPb
, and to give a nontrivial impact on charm production.