"The longer you leave a baby in the same room as a parent, the worse the outcomes are in terms of sleep," said study author Dr. Ian Paul.
There's also a higher risk that infants will migrate into bed with mom, putting them at greater risk for sudden infant death syndrome (SIDS), said Paul, a professor of pediatrics and public health sciences at Penn State College of Medicine.
Last fall, the American Academy of Pediatrics updated its recommendations about "room-sharing" between parents and babies. To lower the chances for SIDS, it advised at least 6 months, and ideally 12 months, in the same bedroom, but not the same bed. Prior guidelines had recommended moving infants to their own rooms by 6 months.
"The recommendation beyond 6 months was not based on real data but more on expert opinion," Paul said. "That led us to question that recommendation."
He said sleep experts have long advocated that after the first few months, "you should transition your baby into their own room to help how well and how long the baby sleeps."
For the new study, researchers reviewed questionnaires given to 230 first-time mothers when their babies were 4, 9, 12 and 30 months old.
At 9 months, babies who slept on their own got 40 minutes more sleep a night than those who shared a room with their mother. Also, those who slept on their own at 9 months slept 45 minutes more a night at the age of 30 months compared to other babies, the study found.
In addition, babies who shared rooms at 4 and 9 months had four times the odds of moving to the parental bed during the night. "That's a known and very established risk factor for SIDS," Paul said.
The study didn't look at how having a baby in the room affects sleep for parents.
Dr. Fern Hauck is a professor of family medicine and public health sciences at the University of Virginia.
She said the study raises questions about the safety of room-sharing, especially because of the evidence it can lead to the potentially dangerous habit of bed-sharing.
But the differences in sleep among the room-sharers at 4 months were small, said Hauck, co-author of a commentary accompanying the study.
© 2017 CBS Interactive Inc. All Rights Reserved.