The Mg-5%Hg-22%Ga(mole fraction) alloy was melted. Aging at 573–673 K for different times was carried out to ensure the fine dispersion of the Mg 5 Ga 2 compound. Scanning electron microscopy (SEM), X-ray diffractometry(XRD) and energy spectrum analysis(ESA) were employed to characterize the microstructures and phases of the Mg-5%Hg-22%Ga alloy. The electrochemical and corrosion behaviors of the above alloy were studied by potentiodynamic, galvanostatic and electrochemical impedance spectroscopy (EIS) measurements. The relationship between the Mg 5 Ga 2 compound and the electrochemical properties of the Mg-5%Hg-22%Ga alloy was discussed. The results demonstrate that the heat treatment at 573–673 K for 24 h accelerates the growth of the intergranular eutectic Mg-Mg 5 Ga 2 and the heat treatment for 200 h prompts the transition of eutectic to dispersed linear Mg phase and Mg 5 Ga 2 matrix. This transition enhances the electrochemical activity and corrosion resistance of the Mg-5%Hg-22%Ga alloy. In the galvanostatic tests with current density of 100 mA/cm 2 , the most negative potential, −1.991 V, occurs in the sample aged for 200 h. The largest corrosion current density of 44.36 mA/cm 2 occurs in the sample aged for 24 h.