Surface treatment of magnesium alloys AZ31 and AZ91HP by a high current pulsed electron beam (HCPEB)was investigated in the present paper. The corrosion resistance of treated samples was tested in a 5% (wt%) NaCl solution,showing remarkably improvement as manifested by polarization curves. According to EPMA analysis, the intermetallic Mg17Al12 in the surface layer of AZ91HP sample almost disappeared after the treatment of HCPEB, leaving the surface layer in a state of supersaturated solid solution. Both the augmentation of aluminum content and the formation of supersaturated structure in the surface layer are believed to contribute to the improved corrosion resistance of AZ31 and AZ91HP.