The paper studies the influence of the content of aluminum nitride nanoparticles on the structure and mechanical properties of the ZK51A magnesium alloy. The microstructure investigations with optical and electron microscopy show that 1 wt.% AlN promotes the best grain refinement and size distribution. According to tensile strength testing of the ZK51A alloy, grain refinement is not a dominating mechanism in the property improvement of the alloy after heat treatment. The maximum values of mechanical parameters are achieved at the lowest (0.1 wt.%) content of aluminum nitride. The main mechanism of mechanical characteristics increase with the addition of AlN nanoparticles is dispersion hardening.