The local–resource–competition hypothesis predicts that where philopatric offspring compete for resources with their mothers, offspring sex ratios will be biased in favour of the dispersing sex. This should produce variation in sex ratios between populations in relation to differences in the availability of resources for philopatric offspring. However, previous tests of local resource competition in mammals have used indirect measures of resource availability and have focused on sex–ratio variation between species or individuals rather than between local populations. Here, we show that the availability of den sites predicts the offspring sex ratio in populations of the common brushtail possum. Female possums defend access to dens, and daughters, but not sons, occupy dens within their mother's range. However, the abundances of possums in our study areas were determined principally by food availability. Consequently, in food–rich areas with a high population density, the per–capita availability of dens was low, and the cost of having a daughter should have been high. This cost was positively correlated with male bias in the sex ratio at birth. Low per capita availability of dens was correlated with male bias in the sex ratio at birth.