A toner cartridge is detachably attached to an image forming apparatus and supplies toner to the image forming apparatus. The locking mechanism is positioned either at a locking position or at a non-locking position. Shortly after the toner cartridge has been attached to the image forming apparatus, the locking mechanism is at a non-locking position. When a user operates a driving member of the toner cartridge after the toner cartridge has been attached to the image forming apparatus, the operating lever engages the locking mechanism to cause the locking mechanism to move to a locking position. When the locking mechanism is at the locking position, the locking mechanism limits the driving member to move relative to the engagement portion, so that the toner cartridge is not allowed to be detached from the image forming apparatus.