<p>An image forming apparatus which permits a process cartridge to be easily replaced and is more convenient. The image forming apparatus comprises a cartridge tray which can move in one direction for the printer main body while containing the process cartridges so as to be arranged removably in parallel in the one direction, and a latching mechanism (recess, roller) for latching the cartridge tray to the printer main body under a state where the cartridge tray is moved from the printer main body. At least one latching position where the cartridge tray is to be latched to the printer main body by the latching mechanism is provided between a position where the cartridge tray is attached to the printer main body and a position where the cartridge tray is drawn out to the maximum from the printer main body.</p>