An image forming apparatus includes a judging unit for judging as to whether paper jamming occurs in the medium feeding unit at a time that the paper jamming occurs in the medium conveyance route and a controller for controlling the medium positioned on an upstream side of the medium feeding unit to be conveyed into the medium feeding unit when judging that no paper jamming occurs in the medium feeding unit, to allow the feeding unit detaching from the apparatus body without tearing or breaking the jammed paper.