x -axis of the setup. Beams of energy E$_{0}$ between 80 MeV and 180 MeV were used and collimated to pencil beams of 1 cm diameter in order to prevent the magnet from being damaged from direct radiation exposure. 

A slab phantom was produced from polymethyl methacrylate (PMMA, ρ = 1 . 186 gcm − $^{3}$) and mounted horizontally in the air gap between the poles of a C-shaped permanent magnet assembly. It consisted of two slabs, such that a film dosimeter was placed horizontally in the central plane parallel to the beam. The contact area of the slabs was bevelled by α = 1 ◦ to reduce the dependence of the dose distribution on the film material and a possible air gap between the phantom and film [19]. Two vertically oriented pins in the phantom and corresponding holes in the films ensured a reproducible alignment of the film relative to the phantom. 

A self-developing Gafchromic EBT3 film detector of 280 µ m thickness (Ashland, Covington, USA) was used to measure the planar dose distributions in the central plane of the proton beam, as it provides a submillimeter spatial resolution and is largely unaffected by magnetic fields [20]. 

The phantom and film detector were placed inside a transversal magnetic field (see Supporting Figure A.7) produced by a magnet assembly consisting of two Nd$_{2}$Fe$_{14}$B permanent magnet poles and a yoke. The maximum magnetic flux density of B$_{0}$ = 0 . 95 T was chosen to be comparable to that of existing MR- integrated photon therapy systems with flux densities between 0 . 35 T and 1 . 5 T [6, 7, 8, 9]. The main field component was aligned parallel to the z -axis (pointing downwards), and caused a deflection of the proton beam in the (positive) y -direction. 

Prior to the first irradiation experiment, all three magnetic field components were mapped at 5 mm reso- lution using an automated magnetometry setup, comprising of a robotic positioning device and a Hall probe (MMTB-6J04-VG, Lake Shore Cryotronics, Westerville, USA) that was connected to a digital Gaussmeter (Model 421, Lake Shore Cryotronics) [21]. To monitor the main field component’s temporal stability, point measurements along the central x -axis at 5, 10 and 15 cm depth relative to the phantom’s front face were performed after each irradiation experiment. Deviations were within 3 mT, which was smaller than the measurement precision (4 mT), and not systematic. 

Further details of the experimental setup can be found in Supporting Appendix A.1. 

## Beam deflection and Bragg peak dislocation 

The influence of the magnetic field on the proton dose distribution could be observed on the film dosimeter signal, as depicted for 180 MeV in Figure 2. The characteristic shape of the proton dose distribution was visible both with and without magnetic field, but with magnetic field the beam followed a deflected trajectory 

