A magnetic resonance imaging apparatus includes an imaging unit and a compensation unit. The imaging unit acquires image data by imaging that applies a pre-pulse for controlling contrast. The compensation unit suppresses a remnant magnetic field having an intensity according to slice position. The remnant magnetic field is at an application timing of the pre-pulse and due to an eddy current generated by at least one gradient magnetic field applied before applying the pre-pulse.