Consider a compact manifold M with boundary ∂M endowed with a Riemannian metric g and a magnetic field . Given a point and direction of entry at the boundary, the scattering relation determines the point and direction of exit of a particle of unit charge, mass, and energy. In this paper we show that a magnetic system (M, ∂M, g, ) that is known to be real-analytic and that satisfies some mild restrictions on conjugate points is uniquely determined up to a natural equivalence by . In the case that the magnetic field is taken to be zero, this gives a new rigidity result in Riemannian geometry that is more general than related results in the literature.