(Health.com) -- Nicole Longaro felt like she was at the pediatrician every other day when her now 3-year-old daughter, Alyssa, first started day care. Alyssa was 4 months old, and Longaro had to return to her job as a human resources manager for a large commercial bank.

"She literally had at least four ear infections in the first year she went to day care," she says. And now, her second daughter, Kylie, is following suit. "She has already been on a nebulizer once and she isn't even 6 months old."

Like older sister Alyssa, Kylie attends a group day-care center in eastern Long Island.

"My pediatrician said, 'Your friends whose kids don't go to day care think their kids are so healthy, but they will be here all the time the second they start school and I will be seeing less of you and your girls,'" Longaro says.

A large new study in December issue of the Archives of Pediatrics and Adolescent Medicine suggests her pediatrician is right.

Babies who attend large-group child-care centers before they are 2 ½ years of age do get more respiratory and ear infections than those cared for at home, but they are less likely to come down with these ailments once they start elementary school, according to the study.

"Children have infections at the time they initiate large-group activities, whether they do it earlier or later," says study author Sylvana M. Côté, Ph.D., of Ste-Justine Hospital and the University of Montreal, Quebec, in an email. "I argue earlier is better to have infections because then kids do not miss school at a crucial time -- when learning to read and write."

The researchers looked at 1,238 Canadian families with babies born in 1998 and followed the children from the age of 5 months to 8 years.

Compared with youngsters who stayed at home until they started school, babies who attended large-group child care before age 2½ came down with more respiratory bugs and ear infections during their early preschool years (before 3½ ), but fewer respiratory and ear infections once they started elementary school.

Group child care did not affect risk for stomach bugs one way or another during the study period.

Large child-care centers were defined as facilities with as many as 10 groups of eight to 12 children.

The researchers found a protection against later infections only when they looked at kids who went to the larger child-care centers, not those cared for in small facilities, such as those in a home setting with three to eight kids.

Youngsters cared for at home but who went into a larger day-care setting after age 2½ did have more colds and ear infections at that time, but they also had just as many infections as kids cared for at home when they started elementary school.

Exactly how a large-group day care affects a toddler's immune system is not clear. It may be that children are exposed to many different viruses at day care, priming their immune system to fight these same infections later on.

"All children need to face the increased frequency of infection when they start interacting with a larger number of children in order to build immunity, and day care contributes to this process," Côté says.

There may exist a window of opportunity for toddlers to build up their immunity early. Those who attended large day-care centers after age 2½ did not receive the same protection against illness during their elementary school years as their counterparts who started group day care at younger ages, the new study showed.

"This study shows scientifically what we pediatricians have observed through experience," says Gail Demmler-Harrison, M.D., professor of pediatrics-infectious disease at Baylor College of Medicine in Houston, Texas.

Calling the findings "good news for working moms," Demmler-Harrison offers these words of advice to moms who send their babies to day care: "Hang in there. It may be rough when they are young, but when they get to elementary school, they will be immune to many of the infections."

She adds that the enhanced ability to fight off infections can be added to the list of benefits of group day care.