High-yielding dairy cows are often fed high proportions of cereal grain and pulses. For several reasons, it would be desirable to replace these feed sources with forage, which is not suitable for human consumption. Feeding large amounts of forage to dairy cows could also make dairy production more publicly acceptable in the future. In this study, we estimated genetic parameters for total dry matter intake (DMI), DMI from forage (DMI For), energy-corrected milk (ECM), and ECM produced from forage (ECM For). A total of 1,177 lactations from 575 cows of Swedish Red (SR) and Holstein (HOL) dairy breeds were included in the study. Mixed linear animal random regression models were used, with fixed effect of calving season and lactation week nested within parity 1 and 2+, fixed effect of calving year, and random regression coefficients for breeding value (up to linear) and permanent environmental effect (up to quadratic) of the cow. Heritability for DMI and DMI For was generally higher for HOL than for SR in all-parity data and in later parities; however, the opposite was true for first parity. Heritability for DMI and DMI For during the first 8 wk averaged 0.11 and 0.15, respectively, in all-parity data for the 2 breeds. Corresponding values for ECM For and ECM were 0.21 and 0.29, respectively. In first parity, values were 0.32, 0.36, 0.28, and 0.51, respectively. The genetic correlation between DMI and DMI For was high, above 0.83, and fairly constant across the lactation. The genetic correlation between ECM For and ECM was close to unity in the later part of lactation for both breeds, but was around 0.8 in the early lactation for both breeds; it decreased for HOL to 0.54 in wk 17. The genetic correlations between DMI and ECM For and between DMI For and ECM For were low and negative for HOL (absolute value ~0.2-0.3), but changed for SR from weakly positive in early lactation to negative values and back to positive toward the end of lactation. For most traits, the correlation between wk 1 and wk 8 into the lactation was very high; the lowest value was for DMI in HOL at 0.81. The genetic correlation between parities was rather high in the first part of the lactation. During the first 8 wk, the correlation was lower for HOL than for SR, except for ECM. We found that DMI For and ECM For showed reasonably large heritability, and future work should explore the possibility of genomic evaluations.