The effects of hydrogen levels on microstructure of porosity and mechanical properties of magnesium alloy castings were investigated. The hydrogen content of AZ91 alloy melt under Ar+HFC-134a mixed gas protection was 103 cm3 kg−1, which was less than that of 139 cm3 kg−1 under flux protection, therefore the effect of gas protection was better. The porosity ratio in microstructure of castings melted under gas protection was 1˙8%, which was also less than that of 2˙6% under flux protection. The hydrogen content of melt under flux protection and degassed with Ar gas was 70 cm3 kg−1, and the corresponding porosity ratio in microstructure of castings was only 0˙6%. The density of the samples was increased with decreasing hydrogen content. The tensile strength of AZ91 alloy casting sample under flux protection and degassed with Ar gas was 21% higher than that of undegassed one, and the elongation was also 50% higher.