A model for simulating charge exchange (CX) of fast ions with background atoms in magnetically confined fusion plasmas has been implemented in the ASCOT orbit-following code. The model was verified by comparing simulated reaction mean free paths to analytical values across a range of fusion-relevant parameters. ASCOT was used to simulate beam ions slowing down in the presence of CX reactions in a MAST-U target scenario. ASCOT predicts the CX-induced loss of beam power to be 22%, which agrees to within 15% with the TRANSP prediction. Because of CX, plasma heating and current drive by beam ions are strongly reduced towards the edge. However, an overall lower but noticeable increase of up to 20% in current drive is predicted closer to the core. The simulated deposition of fast CX atoms on the wall is concentrated around the outer midplane, with estimated peak power loads of 70–80 kWm-2 on the central poloidal field coils (P5) and the vacuum vessel wall between them. This analysis demonstrates that ASCOT can be used to simulate fast ions in fusion plasmas where CX reactions play a significant role, e.g., in spherical tokamaks and stellarators.