Thermal stability of originally single crystalline wurtzite Mg x Zn 1−x O (x 0.3) films implanted at room temperature with 166 Er ions is studied by a combination of Rutherford backscattering spectrometry, time-of-flight elastic recoil detection analysis, x-ray diffraction analysis, and atomic force microscopy. The MgZnO films exhibit a complex behavior during postimplantation annealing associated with compositional changes and surface erosion in addition to Er accumulation at the surface. The importance of these processes depends on the Mg content, annealing temperature, and amount of implantation damage. Specifically, increases in the Mg content as well as the implantation damage enhance the compositional changes in the near-surface region and give rise to altered stoichiometry and Mg-enriched phase separation. In its turn, the rate of surface erosion in MgZnO under the thermal treatment depends on temperature, MgZnO composition, and the amount of implantation damage nontrivially, which is attributed to the compositional changes in the near-surface region assisted by the implantation damage.