An image forming apparatus comprising: an image forming section (30Y, 30M, 30C, 30K) for forming an image to be transferred; an intermediate transfer section to which the image having been formed by the image forming section (30Y, 30M, 30C, 30K) is transferred; a secondary transfer section which is switchable between a pressed state where the secondary transfer section is pressed against the intermediate transfer section and which transfers to a sheet, the image having been transferred to the intermediate transfer section and a separated state where the secondary transfer section is separated from the intermediate transfer section; a detection section for detecting a pattern image (100Y, 100M, 100C, 100K) for correction of the position having been transferred to the intermediate transfer section; characterized by a correction section for performing a first correction processing which is a correction processing of the image position with respect to a main scanning direction and a second correction processing which is a correction processing of the image position with respect to a component other than the main scanning direction as correction processing of a position of the image formed by the image forming section (30Y, 30M, 30C, 30K) based on a detection result of the pattern image (100Y, 100M, 100C, 100K) for correction by the detection section; and a transfer control section for performing switching control between the pressed state and the separated state, wherein, when the correction section carries out, as the correction processing, the first correction processing, the transfer control section sets the secondary transfer section in the pressed state, and when the correction section carries out, as the correction processing, the second correction processing, the transfer control section sets the secondary transfer section in the separated state. an image forming section (30Y, 30M, 30C, 30K) for forming an image to be transferred; an intermediate transfer section to which the image having been formed by the image forming section (30Y, 30M, 30C, 30K) is transferred; a secondary transfer section which is switchable between a pressed state where the secondary transfer section is pressed against the intermediate transfer section and which transfers to a sheet, the image having been transferred to the intermediate transfer section and a separated state where the secondary transfer section is separated from the intermediate transfer section; a detection section for detecting a pattern image (100Y, 100M, 100C, 100K) for correction of the position having been transferred to the intermediate transfer section; characterized by a correction section for performing a first correction processing which is a correction processing of the image position with respect to a main scanning direction and a second correction processing which is a correction processing of the image position with respect to a component other than the main scanning direction as correction processing of a position of the image formed by the image forming section (30Y, 30M, 30C, 30K) based on a detection result of the pattern image (100Y, 100M, 100C, 100K) for correction by the detection section; and a transfer control section for performing switching control between the pressed state and the separated state,