Editor's note: This story has been updated throughout.

State Sen. Wendy Davis, the Democratic candidate for governor, reveals in her new book that she terminated two pregnancies for medical reasons, both more than 15 years ago.

Davis' new book, Forgetting to Be Afraid, officially goes on sale on Tuesday. Details of the book were first reported by The Associated Press and the San Antonio Express-News on Friday evening.

The book reveals that Davis terminated a pregnancy in 1997 during the second trimester due to the fetus having an acute brain abnormality after Davis received multiple medical opinions suggesting that the baby would not survive. Davis describes in heart-wrenching detail how the experience crushed her.

“I couldn’t breathe. I literally couldn’t catch my breath," Davis wrote of her reaction when she first learned the diagnosis. "I don’t remember much else about that day other than calling [husband] Jeff, trying to contain my hysterical crying. The rest of it is a shocked, haze-filled blur.”

The doctor said that the baby wouldn’t survive to full term, and if she did, she would suffer and probably not survive delivery. “We had been told that even if she did survive, she would probably be deaf, blind, and in a permanent vegetative state," Davis wrote.

"At some point in the almost two weeks of second and third and fourth opinions and tortured decision making, I could feel her little body tremble violently, as if someone were applying an electric shock to her, and I knew then what we needed to do," Davis added. "She was suffering."

After their doctor "quieted" the baby, who Davis and her husband had named Tate, Davis delivered the baby by cesarean section. The next day, she wrote, "we asked an associate minister from our church who was a trusted friend to come and baptize her. We took photographs of her. And we said our goodbyes."

She said a nurse brought the baby to her and "had dressed her in a tiny pink dress and placed a knit cap on her enlarged head."

"On her feet were crocheted booties, and next to her was a small crocheted pink bunny. Jeff and I spent the better part of the day holding her, crying for her and for us,” Davis wrote. After the baby was "taken away and cremated," Davis describes the despair that followed.

"An indescribable blackness followed. It was a deep, dark despair and grief, a heavy wave that crushed me, that made me wonder if I would ever surface," she wrote. "It would take me the better part of a year to ultimately make my way up and out of it. And when I finally did come through it, I emerged a different person. Changed. Forever changed.”

An earlier pregnancy in 1994 was terminated as it was an ectopic pregnancy, in which an embryo implants outside the uterus. This time, Davis and her husband were pregnant with a baby boy, who they referred to as "Baby Lucas."

Davis says that her doctor said it would be dangerous to her health to continue the pregnancy. "The only medical option was to have surgery to terminate the pregnancy and remove the affected fallopian tube — which in Texas is technically considered an abortion, and doctors have to report it as such," she wrote.

“We all grieved the loss, but I grieved most deeply — a sadness and an emptiness took root in me where Baby Lucas had been," Davis wrote.

Davis received national attention in 2013 after her special session filibuster of proposed abortion regulations. The legislation didn't pass during that session, but it passed during a second special session. Davis wrote that she had considered talking about the terminated pregnancies during the filibuster, but she said the timing wasn't right.

Both pregnancies occurred after Davis' two daughters had been born but before the start of her political career.

Reached on Friday night, state Sen. Leticia Van de Putte, the Democratic nominee for lieutenant governor, said she “had to stop crying” before she could call a reporter back. She knew of Davis’ experience with abortion, she said, adding, “I am very proud of her courage to share something that was a very tragic part of her life.”

Van de Putte described Davis’ second-trimester abortion as “very, very personal.”

“She lost her daughter,” Van de Putte said.

Cecile Richards, the president of Planned Parenthood Votes, praised Davis for sharing her story.

"Wendy Davis understands that abortion needs to remain a safe and legal procedure for a woman to consider if and when she needs to," Richards said. "And she is running for office to make sure that the next generation of Texas women have the same health care access that she had when she needed it.

Joe Pojman, the executive director of Texas Alliance for Life, expressed sympathy for Davis over the loss of the two babies.

"We do not favor or advise abortion in cases when the unborn child has disabilities, just as we cannot advocate taking the life of a newly born child who has severe disabilities," Pojman said in a statement. He added that House Bill 2, the abortion legislation that passed the Legislature in 2013, would not have prevented either of these terminations.

In a statement Saturday, Attorney General Greg Abbott, Davis' Republican opponent in the race for governor, expressed his sympathy for the Davis family.

"The unspeakable pain of losing a child is beyond tragic for any parent,” Abbott said. “As a father, I grieve for the Davis family and for the loss of life."

State Rep. Jessica Farrar, D-Houston, said she didn't think the revelations would impact Davis with voters because the people who would be troubled by the pregnancy terminations “were the people who were not going to vote for her anyway.”

Matt Mackowiak, a Republican political consultant, said he thinks the Davis abortion news has both positive and negative political implications.

On the positive side, he said, “it’s something I think some number of Texas women can identify with,” and “adds another layer to her personal narrative.”

On the negative side, Mackowiak said, it “puts the focus back on an issue they’ve tried to not let define her, and that’s abortion as a policy issue.”

Mackowiak also said if he looks at the news through the lens of a cynic, “I would say she’s going to get several days of significant media out of this. I think that will impact book sales and also pay dividends for the campaign.”

Terri Langford and Alexa Ura contributed to this report.

Disclosure: Planned Parenthood was a corporate sponsor of The Texas Tribune in 2011. A complete list of Texas Tribune donors and sponsors can be viewed here.