A liquid cartridge configured to be inserted into a case of a liquid-consuming device in a frontward direction intersecting a gravitational direction and attached to the case in an attached state, the liquid cartridge storing liquid therein and comprising: a front surface facing frontward in the frontward direction in the attached state of the liquid cartridge ; a rear surface spaced apart from the front surface in the frontward direction in the attached state of the liquid cartridge ; an upper surface disposed between the front surface and the rear surface , the upper surface facing upward in the attached state of the liquid cartridge ; a liquid supply portion provided at the front surface and configured to supply the liquid to outside of the liquid cartridge ; a detection portion including a light-receiving portion configured to receive incident light thereon, the light-receiving portion being positioned upward relative to the upper surface in the attached state of the liquid cartridge , the detection portion being configured to change a state of the incident light depending on a state of the liquid cartridge ; an electrical interface disposed at the upper surface , the electrical interface being positioned frontward relative to the light-receiving portion in the attached state of the liquid cartridge ; and an engaging surface facing rearward and configured to be engaged with the case of the liquid-consuming device in the attached state of the liquid cartridge such that the engagement between the engaging surface and the case of the liquid-consuming device restricts the liquid cartridge in the attached state from moving rearward; characterised in that : the engaging surface is positioned frontward relative to the light-receiving portion in the attached state of the liquid cartridge . a front surface facing frontward in the frontward direction in the attached state of the liquid cartridge ; a rear surface spaced apart from the front surface in the frontward direction in the attached state of the liquid cartridge ; an upper surface disposed between the front surface and the rear surface , the upper surface facing upward in the attached state of the liquid cartridge ; a liquid supply portion provided at the front surface and configured to supply the liquid to outside of the liquid cartridge ; a detection portion including a light-receiving portion configured to receive incident light thereon, the light-receiving portion being positioned upward relative to the upper surface in the attached state of the liquid cartridge , the detection portion being configured to change a state of the incident light depending on a state of the liquid cartridge ; an electrical interface disposed at the upper surface , the electrical interface being positioned frontward relative to the light-receiving portion in the attached state of the liquid cartridge ; and an engaging surface facing rearward and configured to be engaged with the case of the liquid-consuming device in the attached state of the liquid cartridge such that the engagement between the engaging surface and the case of the liquid-consuming device restricts the liquid cartridge in the attached state from moving rearward; characterised in that : the engaging surface is positioned frontward relative to the light-receiving portion in the attached state of the liquid cartridge . <EOS>