Doctors feared for Brooke Shields’ life during the birth of her baby, and cut short her 18 hours of labor with an emergency C-section after she and her child came dangerously close to tragedy.

That’s the untold story behind the May 15 birth of Brooke’s daughter Rowan Francis, sources close to the actress told The ENQUIRER.

Brooke’s obstetrician rushed to operate after the temperatures of both Brooke and her baby soared, and the baby’s heartbeat indicated the infant was in distress.

“In order to save both their lives, the doctor cleared out the delivery room and performed an emergency cesarean,” said an inside source. “If he hadn’t stepped in when he did, Brooke and the baby may not have made it.”

Brooke, 38, and her husband Chris Henchy had been desperately trying to have a baby for years and the actress had suffered several miscarriages, the insider said.

“The cervical cancer she overcame in the mid-1990s left her cervix scarred and she told me her problem was not getting pregnant, but staying pregnant once she conceived,” revealed the inside source.

When Brooke finally got pregnant again after in vitro fertilization the “Suddenly Susan” star was delighted. She took great care of herself, staying in close contact with her doctors, eating right and taking yoga classes to help her remain flexible.

“Things went so smoothly that nobody dreamed giving birth could turn into such a nightmare for Brooke,” a family friend told The ENQUIRER.

Brooke had been advised by doctors to have a planned C-section, sources say. But she had coached a girlfriend through natural childbirth and decided to try delivering the old-fashioned way.

Her water broke at home around 8:30 p.m. on May 14, and Chris rushed her to New York University Medical Center. As her contractions intensified, Brooke was hooked to an epidural anesthesia to help reduce her pain — and then things began to go wrong.

“After hours of labor, Brooke had dilated only 2 centimeters,” the inside source said. “The baby wanted to come out, but couldn’t.

“Her doctor didn’t want Brooke to push too much, fearing that the additional stress could rupture or tear her uterus, or worse yet, that she could hemorrhage.”

Brooke labored for 16 hours, and although she was becoming exhausted from her efforts, she was still not dilating. Doctors feared that scars from her cancer treatment were blocking the baby’s descent into the birth canal.

“The labor pains were so unbearable for Brooke that she got sick,” the family friend revealed.

After 17 hours of labor, Brooke started running a high fever. Soon the baby’s heart was racing and her temperature rising like her mother’s — a clear sign she was in distress.

Revealed another source: “The doctors worried that Brooke would die. And Brooke was hysterical because something obviously was going wrong. She didn’t want to lose the baby.”