We aimed to evaluate the magnesium content in human cirrhotic liver and its correlation with serum AST levels, expression of hepatocellular injury, and MELDNa prognostic score. In liver biopsies obtained at liver transplantation, we measured the magnesium content in liver tissue in 27 cirrhotic patients (CIRs) and 16 deceased donors with healthy liver (CTRLs) by atomic absorption spectrometry and within hepatocytes of 15 CIRs using synchrotron-based X-ray fluorescence microscopy. In 31 CIRs and 10 CTRLs, we evaluated the immunohistochemical expression in hepatocytes of the transient receptor potential melastatin 7 (TRPM7), a magnesium influx chanzyme also involved in inflammation. CIRs showed a lower hepatic magnesium content (117.2 (IQR 110.5–132.9) vs. 162.8 (IQR 155.9–169.8) μg/g;p< 0.001) and a higher percentage of TRPM7 positive hepatocytes (53.0 (IQR 36.8–62.0) vs. 20.7 (10.7–32.8)%;p< 0.001) than CTRLs. In CIRs, MELDNa and serum AST at transplant correlated: (a) inversely with the magnesium content both in liver tissue and hepatocytes; and (b) directly with the percentage of hepatocytes stained intensely for TRPM7. The latter also directly correlated with the worsening of MELDNa at transplant compared to waitlisting. Magnesium depletion and overexpression of its influx chanzyme TRPM7 in hepatocytes are associated with severity of hepatocyte injury and prognosis in cirrhosis. These data represent the pathophysiological basis for a possible beneficial effect of magnesium supplementation in cirrhotic patients.