The invention discloses a cast magnesium alloy of low linear shrinkage, which belongs to the field of magnesium alloys. The magnesium alloy consists of Mg, Al, Zn, Mn, rare earth, Nb, Li and M element, wherein the materials have the following weight percentage composition: 1.5-25 percent of Al, 0.1-3.5 percent of Zn, 0.1-2.2 percent of Mn, 0.0002-16 percent of rare earth, 0.0002-4 percent of Nb, 0.0002-9 percent of Li, 0.0002-2 percent of M element and the balance Mg; and the M element is at least one of Zr, Ti, Sr, Ca, C and B. According to the heat-resistant magnesium alloy, the rare earth element and the Nb element are added into the magnesium alloy, so that the structure of beta phase is changed; the Zr element and the M element are added to refine crystal grains; due to combined action of the elements, latent heat of crystallization during alloy solidification is changed; and the magnesium alloy which has superior mold-filling capacity, low shrinkage, superior mechanical property and good machinability, fluidity and die-cast performance and is suitable for casting is obtained.