It’s every parent’s nightmare – an exhausted baby who just won’t stop crying when it’s time go to sleep. Even worse? The baby finally falls asleep in your arms but wakes again and starts sobbing when laid in the crib.

 If small children swallow button batteries, they can get stuck in the esophagus and cause burns or worse.

The solution is a magic pair of numbers – five and eight – according to Japanese researchers who did experiments with 21 moms trying to lull their little ones into slumber.

Here’s how it works: Walk your baby for a minimum of five minutes with no sudden movements, at which time the little one will be calm, if not asleep, according to the study. Then sit and hold baby for another eight minutes before making a gentle crib transfer.

Placing the sleeping infant in the bed without first sitting quietly for a full eight minutes ended in disappointment, according to study coauthor Dr. Kumi Kuroda, team leader of the affiliative social behavior unit at the RIKEN Center for Brain Science in Saitama, Japan.

“Although we did not predict it, the key parameter for successful laydown of sleeping infants was the (delay) from sleep onset,” Kuroda said in a statement.

“I have raised four children and I performed these experiments, but even I couldn’t foresee the key results of this study until the statistical data came up,” Kuroda added.

Timing guidelines might be helpful for some parents and caregivers, but won’t necessarily work for everyone, said Atlanta pediatrician Dr. Jennifer Shu, medical editor-in-chief of the American Academy of Pediatrics’ parenting website.

“Babies are different and (some) might not all respond to this system,” said Shu, who was not involved in the study.

Parents and caregivers shouldn’t use this technique regularly if a baby can fall asleep on their own, added Shu, who is also the coauthor of “Heading Home With Your Newborn: From Birth to Reality.”

“The goal should be to make sure baby is getting good sleep using this or other techniques while eventually encouraging them to fall asleep on their own, both at the beginning of bedtime, as well as through the night (when they wake),” Shu said in an email.

Heartbeat data key

The study, published Tuesday in the journal Current Biology, examined the impact of four soothing behaviors on infant crying. Mothers were asked to carry their baby while walking, walk with their baby in a stroller or “mobile cot,” hold their baby when seated, and finally, put their baby directly into a crib or cot. Researchers monitored the baby’s heartbeats and videotaped each session to record and time the response.

Sitting and holding a crying baby didn’t work, according to the study – monitors showed that the baby’s heart rate rose and the behavior continued. Not surprisingly, putting the crying baby directly into the crib also didn’t work.

Only movement calmed the babies, the study found. Within five minutes, all of the babies carried by walking moms had stopped crying, heart rate had slowed, and 46% of the infants were asleep. An additional 18% of babies fell asleep within another few minutes, the study found.

However, the five-minute walk resulted in sleep only for crying babies. “Surprisingly, this effect was absent when babies were already calm beforehand,” Kuroda said.

The researchers saw similar results when parents pushed babies in strollers, but the impacts were not as robust.

Babies with mothers who faced changing stress levels during pregnancy are predisposed to feeling frequent negative emotions like fear and distress.

Stress during pregnancy may have a negative emotional impact on babies, study finds

Now for the even harder part: putting sleeping babies down without waking them. A third of the babies in the study woke up immediately after being laid down, no matter how gently. But it wasn’t the touch of the bed on a baby’s body that woke them, the study found. Instead, monitors showed the baby’s heart rate response shot up when the infant was first detached from the mother’s body.

However, when babies were held for an additional eight minutes, they entered a more stable state of sleep – one that did not waver when they separated from their mom, the researchers found.

Why does carrying work?

Human babies, like other mammals, respond to what is called the “transport response,” an innate reaction seen in species with infants that are too immature at birth to walk or care for themselves.

You see it in nature videos all the time: Mother lions, tigers and other wild cats, as well as their domesticated cousins, carry their babies by the scruff of the neck. So do wild and domestic dogs, mice and rats. Great apes, monkeys and other primates carry their babies on their back, where babies quiet down and cling, as do opossums and giant anteaters. Marsupials like kangaroos, koalas and wallabies all have specialized pouches to cradle their babies as they grow.

The response appears instantaneous – once Mom picks up the baby and begins moving, the infant is relatively docile and the rate of their heart slows, according to research done by Kuroda and her team.

Unfortunately, it appears humans aren’t as lucky as other mammalian moms, and need to carry their young longer to obtain the same response. There’s another thing that sets people apart – the need for human babies to learn to sleep on their own.

“Holding or rocking a baby completely to sleep creates a routine that the baby will learn to expect,” Shu said. “When the baby wakes up in the middle of the night in a stage of light sleep (as we all do), they may require the routine to be performed again.”

For babies 4 months and older, the AAP recommends putting them to bed when they are drowsy instead of waiting for them to fully fall asleep.

And don’t rush to soothe a baby over 3 months old when they wake, the AAP recommended. Just like adults, the baby may well wiggle and fuss and fall back asleep.

Be sure to follow safe sleep guidelines: You should always put babies to sleep on their back for naps and nighttime, in an approved crib without bumpers, pillows, soft toys, quilts, comforters or blankets.