The spatially-resolved spectroscopic optical emission of various lines of a dc-magnetron sputtering discharge (with cylindrical symmetry) is studied. The discharge works with an aluminium-based alloy cathode. Ar-N 2 gas mixtures are used. Emission lines corresponding to the cathode (Al) and the gas discharge species (Ar, N 2 , N + 2 , N) are considered. The three-dimensional emission profiles, I (r, z), of the lines are measured, where r is the distance from the centre of the cathode and z is the height from the cathode. I (r, z) profiles are studied as a function of the total pressure, the gas composition and the electrical power. In order to compare the results, I (r, z) profiles are fitted with an empirical analytical function. It turns out that the three-dimensional emission profiles of the various lines behave differently. The results are understood by taking into account the motion of electrons in our measured magnetic field distribution and the role of electrons in populating the upper levels of the optical transitions.