A magnetic resonance imaging apparatus includes a controller and a deriving unit. The controller performs first imaging for acquiring first image data on a region including a target and the diaphragm, second imaging for acquiring, with application of motion detection pulses for detecting a respiratory phase, second image data including the target at a first respiratory phase and third image data including the target at a second respiratory phase different from the first respiratory phase, and third imaging for acquiring fourth image data. The deriving unit detects the position of the diaphragm from the first image data and derives a region to which the motion detection pulses are applied. In the performing of the second imaging, the controller detects a respiratory phase by the application of the detection pulses and controls timings at which the second image data and the third image data are acquired.