In this work, the effect of the microstructure on corrosion behavior of selected Mg- and Al-based as cast alloys, was evaluated. The electrochemical examinations were carried out, and then a morphology of corrosion products formed due to local polarization on materials surface, was analyzed. It was documented that the presence of Mg2Si phase plays an important role in the corrosion course of Mg-based alloy. A selective etching was observed in sites of Mg2Si precipitates having “Chinese script”- like morphology. Analogous situation was found for Al-based alloy, where the key role was played by cathodic θ-CuAl2 phase.