The objective of this study was to obtain heritability estimates for longevity (length of life, length of productive life, number of litters) and lifetime productivity traits (lifetime pig production, lifetime pig efficiency, lifetime litter efficiency) and genetic correlation between them and litter size at first farrowing, growth (ADG), backfat thickness (BF), loin depth, lean meat percentage (LMP), phenotypic selection index (PSI), and exterior in 19423 Polish Landrace (L) and 16049 Polish Large White (LW) sows. Heritabilities for longevity and lifetime productivity traits were 0.10-0.13 for L sows and 0.09-0.11 for LW sows depending on the trait definition. The genetic correlations among these traits were all high and positive, ranging from 0.76 to 0.99. Antagonistic genetic correlations (-0.21 to -0.26) were found between longevity traits and PSI and LMP in LW sows, while in L sows the respective parameters were lower and not significant for length of productive life. The number of live-born piglets in the first litter was positively correlated with lifetime pig production and lifetime pig efficiency in both breeds. The genetic correlations of longevity and lifetime pig production with ADG, BF, loin depth and exterior were small, and in most cases, not significant.