Across animal taxa, reproductive success is generally more variable and more strongly dependent upon body condition for males than for females; in such cases, parents able to produce offspring in above-average condition are predicted to produce sons, whereas parents unable to produce offspring in good condition should produce daughters. We tested this hypothesis in the collared flycatcher (Ficedula albicollis) by cross-fostering eggs among nests and using the condition of foster young that parents raised to fledging as a functional measure of their ability to produce fit offspring. As predicted, females raising heavier-than-average foster fledglings with their social mate initially produced male-biased primary sex ratios, whereas those raising lighter-than-average foster fledglings produced female-biased primary sex ratios. Females also produced male-biased clutches when mated to males with large secondary sexual characters (wing patches), and tended to produce male-biased clutches earlier within breeding seasons relative to females breeding later. However, females did not adjust the sex of individuals within their clutches; sex was distributed randomly with respect to egg size, laying order and paternity. Future research investigating the proximate mechanisms linking ecological contexts and the quality of offspring parents are able to produce with primary sex-ratio variation could provide fundamental insight into the evolution of context-dependent sex-ratio adjustment.