Magnesium and its alloys have gained significant attention recently as potential alternatives for biodegradable materials due to their unique biodegradability, biocompatibility, and mechanical properties. However, magnesium alloys tend to have high corrosion rates in biological liquids, thus presenting a potential problem if a magnesium implant/device needs to maintain mechanical integrity for a sufficient period under practical physiological conditions. In this study, hydroxyapatite nanoparticles were used to form magnesium based metal matrix nanocomposites (MMNC) through two processes: friction stir processing (FSP) and a two-state nanoprocessing (TSnP) combining liquid state ultrasonic processing and solid state FSP. In addition, laser surface melting (LSM) was carried out for further surface treatment. In vitro immersion tests indicated that the corrosion rate of MMNC decreased by 52% compared with pure Mg through FSP. Potentiodynamic polarization tests showed that the corrosion current of MMNC decreased by 71% and 30%, respectively, by TSnP and LSM when compared with pure Mg or untreated counterparts. This study suggests that fabrication of MMNC and further processing through FSP and LSM can robustly enhance the corrosion resistance of magnesium, which will boost its potential for biological applications. © 2013 Wiley Periodicals, Inc. J Biomed Mater Res Part B: Appl Biomater, 2013.