1. Long-term effects of conditions during early development on fitness are important for life history evolution and population ecology. Using multistrata mark-recapture models on 20 years of data, we quantified the relation between rearing conditions and lifetime fitness in a long-lived shorebird, the oystercatcher (Haematopus ostralegus). We addressed specifically the relative contribution of short- and long-term effects of rearing conditions to overall fitness consequences. 2. Rearing conditions were defined by differences in natal habitat quality, in which there is a clear dichotomy in our study population. In the first year of life, fledglings from high-quality natal origin had a 1.3 times higher juvenile survival. Later in life (age 3-11), individuals of high-quality natal origin had a 1.6 times higher adult prebreeder survival. The most striking effect of natal habitat quality was that birds that were reared on high-quality territories had a higher probability of settling in high-quality habitat (44% vs. 6%). Lifetime reproductive success of individuals born in high-quality habitat was 2.2 times higher than that of individuals born in low-quality habitat. This difference increased further when fitness was calculated over several generations, due to a correlation between the quality of rearing conditions of parents and their offspring. 3. Long-term effects of early conditions contributed more to overall fitness differences as short-term consequences, contrary to common conceptions on this issue. 4. This study illustrates that investigating only short-term effects of early conditions can lead to the large underestimation of fitness consequences. We discuss how long-term consequences of early conditions may affect settlement decisions and source-sink population interactions.