Mg@ZnO thin films were prepared by DC/RF magnetron co-sputtering in (N2+O2) ambient conditions using metallic Mg and Zn targets. We present a comprehensive study of the effects of film thickness, variation of O2 content in the working gas and annealing temperature on the structural, optical and magnetic properties. The band gap energy of the films is found to increase from 4.1 to 4.24 eV with the increase of O2 partial pressures from 5 to 20 % in the working gas. The films are found to be ferromagnetic at room temperature and the saturation magnetization increases initially with the film’s thickness reaching a maximum value of 14.6 emu/cm3 and then decreases to finally become diamagnetic beyond 95 nm thickness. Intrinsic strain seems to play an important role in the observed structural and magnetic properties of the Mg@ZnO films. On annealing, the as-obtained ‘mostly amorphous’ films in the temperature range 600 to 800°C become more crystalline and consequently the saturation magnetization values reduce.