The effect of Er-rich precipitates on microstructure and electrochemical behavior of the Al–Zn–In anode alloy is investigated. The results showed that with the increase in Er content, the microstructure was refined, the amount of interdendritic precipitates gradually increased, and the morphology changed from discontinuous to continuous network gradually. With the addition of Er element, the self-corrosion potential of the Al–5Zn–0.03In–xEr alloy moved positively, the self-corrosion current density decreased, and the corrosion resistance increased. When the Er content was less than 1 wt.%, the addition of Er improved the dissolution state of the Al–5Zn–0.03In–xEr alloy, and increased the current efficiency of the Al–5Zn–0.03In–xEr alloy. When the Er content was more than 1 wt.%, the current efficiency was reduced. The major precipitate of the alloy was Al3Er. According to the element composition of Al3Er in the Al–Zn–In–Er alloy, the simulated-segregated-phase alloy was melted to explain the effect of Al3Er segregation on the electrochemical behavior of alloys, and the polarization curve and AC impedance spectrum of the simulated-segregated-phase alloy and the Al–Zn–In alloy were measured. The results showed that Al3Er was an anodic segregation phase in the Al–Zn–In–Er alloy, and the preferential dissolution of the segregation phase would occur in the alloy, but the Al3Er phase itself was passivated in the dissolution process, which inhibited the further activation of the dissolution reaction of the Al–Zn–In–Er alloy to a certain extent.