The electrochemical and corrosion behaviors of die-cast AZ91D alloy in 3.5 wt% NaCl solution with different pH were investigated. This die-cast magnesium alloy exhibited a solid solution phase (α) and an intermetallic compound Mg17Al12 (β). In neutral NaCl solution, the weight loss due to corrosion was found to vary linearly with time. The results of SEM surface morphology and XRD of corrosion product revealed that the potential different between α phase and β phase in AZ91D alloy would make the corrosion localized in α phase adjacent to β phase and cause the drop of β phase. In alkaline solution, the results for both open circuit potential and polarization measurements indicated that AZ91D alloy could be passivated due to the formation of a relative stable Mg (OH)2 film.