We consider a localized electronic spin controlled by a circularly polarized optical beam and an external magnetic field. When the frequency of the beam is tuned near an optical resonance with a continuum of higher energy states, effective magnetic fields are induced on the two-level system via the inverse Faraday effect. We explore the process in which the frequency of the beam is made linearly time-dependent so that it sweeps through the optical resonance, starting and ending at the values far away from it. In addition to changes of spin states, Kramers-Kronig relations guarantee that a localized electron can also escape into a continuum of states. We argue that probabilities of transitions between different possible electronic states after such a sweep of the optical frequency can be found exactly, regardless the shape of the resonance. We also discuss extension of our results to multistate systems.