Mothers who are anxious or depressed while pregnant tend to have children who find it hard to get to sleep, research shows.
A study of 14,000 women published in the journal Early Human Development found that mothers classified as anxious while pregnant were 40% more likely than other mothers to have a young child who refused to go to bed, woke early or kept waking up during the night.
A similar effect was found in children born to mothers who were depressed while pregnant.
Lead author Thomas O'Connor from the University of Rochester Medical Center said: "We've long known that a child's sleep is vital to his or her growth, but the origins of problems affecting it remained unclear.
"Now we have evidence that these patterns may be set early on, perhaps even before birth."
Sleep plays a critical role in the healthy development of young children, helping to consolidate memory, regulate metabolism and appetite, and promote good cardiovascular health.
The scientists propose that when a mother-to-be is stressed this disrupts the formation of her child's internal body clock.
O'Connor adds: "This is another piece in the unfolding mystery of just how much the prenatal environment may shape a child's health and development for years to come."