An X-ray imaging apparatus includes an X-ray tube, an X-ray detector, a moving body movable in a predetermined direction, a moving mechanism, a motor, an operating force detector configured to detect an operating force, and a controller configured or programmed to perform mode switching control to switch, based on whether or not an operation to enable manual movement of the moving body has been detected, a control mode to a torque control mode or a position control mode.