In polygynous (multiple queens per nest) ants, queen dispersal is often limited with young queens being recruited within the parental colony. This mode of dispersal leads to local resource competition between nestmate queens and is frequently associated with extremely male-biased sex ratios at the population level. The queen-replenishment hypothesis has been recently proposed to explain colony sex ratio investment under such conditions. It predicts that colonies containing many queens (subject to high local resource competition) should only produce males, whereas colonies hosting few queens (reduced or no local resource competition) should produce new queens in addition to males. We experimentally tested this hypothesis in the ant Formica exsecta by manipulating queen number over three consecutive years in 120 colonies of a highly polygynous population. Queens were transferred from 40 colonies into another 40 colonies while queen number was not manipulated in 40 control colonies. Genetic analyses of worker offspring revealed that our treatment significantly changed the number of reproductive queens. The sex ratio of colonies was significantly different between treatments in the third breeding season following the experiment initiation. We found that, as predicted by the queen-replenishment hypothesis, queen removal resulted in a significant increase in the proportion of colonies that produced new queens. These results provide the first experimental evidence for the queen-replenishment hypothesis, which might account for sex ratio specialization in many highly polygynous ant species.