Nitrogen-fixers can contribute significant amounts of nitrogen (N) and impact ecosystem functioning in diverse aquatic and terrestrial ecosystems. What determines N-fixer abundance still remains poorly understood. Here we experimentally investigate major environmental controls on the abundance of N-fixers: nitrogen to phosphorus (N:P) ratio and light. We grew a N-fixer, cyanobacterium Anabaena flos-aquae, in a multispecies community of freshwater phytoplankton in replicated factorial design treatments with two N:P ratios and two light levels. We show that low N:P ratios promote the dominance of the N-fixer in the community, but only under high light. Under low light, N:P ratio did not have a significant effect on the abundance of the N-fixer. N fixation occurred at low N:P only and increased with increasing light. In contrast, the density of non N-fixing cyanobacteria did not depend on N:P ratios. Green algae dominated under high N:P and high light only, exhibiting the opposite pattern of dominance to N-fixers. These results are consistent with patterns observed in nature and help explain the N-fixer distribution along the environmental gradients of nutrients and light.