The terminal investment hypothesis predicts that individuals should invest more in their present reproduction if they are less likely to survive to future reproductive events. Infections, which reduce viability, may be used by individuals as a cue of a diminishing residual reproductive value and could therefore theoretically trigger an intensification of breeding effort. We tested this hypothesis in a natural population of house sparrows (Passer domesticus). We manipulated the immune system of breeding females by injecting them with a vaccine against the Paramyxo virus, the agent of Newcastle disease. Females were captured and treated immediately after completion of their first clutch either with the vaccine (NDV) or with phosphate buffered saline (PBS). The entire clutch was subsequently removed. We also screened Mhc class I genes of females to assess possible genotype-by-immune treatment interactions on reproductive investment. Our results indicate that vaccinated females were more likely to lay replacement clutches and that the difference in number of eggs between first and replacement clutches was greater for NDV females than for controls. In addition, chick size, both in terms of tarsus length and body mass, was affected by immune activation but in interaction with nestling age and female body mass, respectively. Mhc genotype-by-immune treatment interactions were never significant; however, allelic diversity was positively correlated with nestling survival. These results show that immune system activation is potentially used as a cue of reduced survival prospect and appears to induce a costly terminal investment behavior, and Mhc diversity might be under selection in a natural population of house sparrows.