We investigated the n-type doping of the wide-gap II-VI semiconductor (CdMg)Te. The n-type doping of (CdMg)Te has previously been achieved in only a small range of magnesium concentration. By the use of zinc iodine as dopant source material, we obtained highly doped (CdMg)Te layers up to a magnesium concentration of 40%. The limiting factor for the free carrier concentration at room temperature is the occurrence of a deep level, which dominates the electrical properties at room temperature of layers with more than 30% magnesium. Compensating defects or defect complexes are considered, to explain the observed properties of the deep level, which do not seem to be characteristic of an isolated donor state.