The hepatotoxicity mechanism of cantharidin (CTD), a major active component of Mylabris was explored based on liver lipidome alterations and spatial distributions in female and male rats using lipidomics and matrix-assisted laser desorption/ionization mass spectrometry imaging (MALDI-MSI). After oral CTD exposure, the livers of female rats were screened for 104 differential lipids including lysophosphatidylethanolamine(LysoPE)(20:2/0:0) and diacylglycerol(DG)(18:2/22:4), whereas the livers of male rats were screened for 76 differential lipids including fatty acid(FA)(24:6) and DG(18:0/22:4). According to the MALDI-MSI results, female rats exhibited 12 differential lipids with alteration in the abundance and spatial distribution of phosphatylcholine(PC), phosphatidylethanolamine(PE), lysophosphatidylcholine(LysoPC), and LysoPE in the liver lesion area. On the other hand, male rats exhibited 8 differential lipids with changes in the abundance and spatial distribution of PC, PE, and FA in the liver lesion area. The lipidomics- and MALDI-MSI-detected differential lipids strongly disrupted glycerophospholipid metabolism in both female and male rats. Additionally, phosphatidate phosphatase (Lipin1), choline/ethanolamine phosphotransferase 1 (CEPT1), and phosphatidylethanolamine N-methyltransferase (PEMT) were screened to distinguish CTD hepatoxicity in female and male rats. Western blotting analysis demonstrated a significant elevation in Lipin1 expression in female and male rat livers, accompanied by a decrease in PEMT expression. Furthermore, CEPT1 expression increased significantly in female rat livers and decreased significantly in male rat livers. These findings suggested that CTD could disrupt lipid metabolism in a gender-specific manner. Moreover, the combination of lipidomics and MALDI-MSI could offer valuable insights into CTD-induced hepatotoxicity in rats.