The Mg x Zn y second phases in Mg–5Zn alloy were adjusted by T4 and T6 treatment, and then the role of second phases in the corrosion behavior of Mg–5Zn alloy was investigated. The dimension of the Mg x Zn y second phases is only some hundred nanometers. They present discrete distribution on the boundaries of the as-received sample and continuous distribution in the T6 sample. The T4 sample in absence of second phases exhibits the best corrosion resistance while the T6 sample with the largest volume fraction of second phases exhibits the worst one, which can be attributed to the micro-cathodic effect of second phases.