The objective of the study was to analyse longevity and lifetime performance traits in dependence on access to grazing (G). Data of Holstein and Slovak Spotted dairy cows (143,566 and 30,412 heads culled between 2006 and 2019) were included. Within each breed, three groups of cows were considered: (1) cows not grazed throughout their entire life, (2) cows seasonally grazed as heifers (in summer), (3) cows seasonally grazed throughout their entire life (in summer). Eight (four longevity and four lifetime milk performance) traits were analysed. General Linear Model with fixed factors: G, herd nested within G, culling year, and cow's age at first calving as covariate was applied. Cows of group (1) had the highest 305-day milk yield: 8,005.0±7.1 kg (Holstein) and 5,985.3±13.0 kg (Slovak Spotted) and lifetime milk yield: 18,408.5±59.4 kg (Holstein) and 18,237.2±129.1 kg (Slovak Spotted). Holstein cows of group (1) had the highest length of productive life (882.4±2.5 days) and number of lactations (2.37±0.01). The highest length of productive life (1,298.0±16.4 days) and number of lactations (3.46±0.04) were found in Slovak Spotted cows of group (3). The best lifetime performance (regardless of breed) was expected in cows not grazed; whereas, the best longevity traits were expected in Slovak Spotted cows seasonally grazed throughout their lives. Surprisingly, in Holstein cows, the best longevity traits were found in animals that were not grazed. This suggests that the living conditions of housed Holstein cows did not negatively affect their longevity.