An image forming apparatus which comprises an apparatus body and a cartridge detachably attachable to the apparatus body in an attachment direction, the image forming apparatus forming an image on a recording material when the cartridge is at an attachment completion position of the apparatus body, wherein the cartridge includes a portion-to-be-positioned and an engagement portion, the apparatus body includes: a positioning portion that abuts on the portion-to-be-positioned of the cartridge to position the cartridge with respect to the apparatus body when the cartridge is at the attachment completion position; a first guide portion that guides the engagement portion of the cartridge and has an inlet having a shape corresponding to an outer shape of the engagement portion as seen in the attachment direction and allowing a passage of the engagement portion of the cartridge; a second guide portion that guides the portion-to-be-positioned of the cartridge toward the positioning portion; and a movable member configured to be pressed by the engagement portion of the cartridge, which passes through the inlet of the first guide portion, with movement of the cartridge toward the attachment completion position whereby the movable member is rotated, about a rotation axis orthogonal to the attachment direction, from a first position at which the movable member blocks a guiding path of the portion-to-be-positioned in the second guide portion to a second position at which the movable member does not block the guiding path, wherein the portion-to-be-positioned of the cartridge is moved to a downstream side of the movable member in the attachment direction while the movable member is at the second position, thereby the cartridge reaching the attachment completion position, and wherein the movable member at the first position is configured to be immovable from the first position unless being pressed by the engagement portion. the cartridge includes a portion-to-be-positioned and an engagement portion, the apparatus body includes: a positioning portion that abuts on the portion-to-be-positioned of the cartridge to position the cartridge with respect to the apparatus body when the cartridge is at the attachment completion position; a first guide portion that guides the engagement portion of the cartridge and has an inlet having a shape corresponding to an outer shape of the engagement portion as seen in the attachment direction and allowing a passage of the engagement portion of the cartridge; a second guide portion that guides the portion-to-be-positioned of the cartridge toward the positioning portion; and a movable member configured to be pressed by the engagement portion of the cartridge, which passes through the inlet of the first guide portion, with movement of the cartridge toward the attachment completion position whereby the movable member is rotated, about a rotation axis orthogonal to the attachment direction, from a first position at which the movable member blocks a guiding path of the portion-to-be-positioned in the second guide portion to a second position at which the movable member does not block the guiding path, a positioning portion that abuts on the portion-to-be-positioned of the cartridge to position the cartridge with respect to the apparatus body when the cartridge is at the attachment completion position; a first guide portion that guides the engagement portion of the cartridge and has an inlet having a shape corresponding to an outer shape of the engagement portion as seen in the attachment direction and allowing a passage of the engagement portion of the cartridge; a second guide portion that guides the portion-to-be-positioned of the cartridge toward the positioning portion; and a movable member configured to be pressed by the engagement portion of the cartridge, which passes through the inlet of the first guide portion, with movement of the cartridge toward the attachment completion position whereby the movable member is rotated, about a rotation axis orthogonal to the attachment direction, from a first position at which the movable member blocks a guiding path of the portion-to-be-positioned in the second guide portion to a second position at which the movable member does not block the guiding path, wherein the portion-to-be-positioned of the cartridge is moved to a downstream side of the movable member in the attachment direction while the movable member is at the second position, thereby the cartridge reaching the attachment completion position, and wherein the movable member at the first position is configured to be immovable from the first position unless being pressed by the engagement portion.