Kourtney Kardashian reveals she underwent 'urgent fetal surgery' to save baby's life

Moakler was asked about how she felt when her children criticized her parenting online after Barker, left, began dating reality-television star Kourtney Kardashian, right.

Kourtney Kardashian Barker and Travis Barker's baby boy is safe after a pregnant Kardashian had to undergo "urgent fetal surgery."

The eldest Kardashian sister, 44, shared on Wednesday that she had been hospitalized last week by posting a picture of her holding her husband's hand seemingly in a hospital bed on Instagram.

The mom-to-be wrote in the caption: "I will be forever grateful to my incredible doctors for saving our baby’s life. I am eternally grateful to my husband who rushed to my side from tour to be with me in the hospital and take care of me afterwards, my rock. And to my mom, thank you for holding my hand through this."

She continued, "As someone who has had three really easy pregnancies in the past, I wasn’t prepared for the fear of rushing into urgent fetal surgery. I don’t think anyone who hasn’t been through a similar situation can begin to understand that feeling of fear. I have a whole new understanding and respect for the mamas who have had to fight for their babies while pregnant."

Her caption ended on a grateful note, as she wrote, "Praise be to God. Walking out of the hospital with my baby boy in my tummy and safe was the truest blessing. ??????"

On Friday, Blink-182 revealed on the band's official X, formerly Twitter, that "due to an urgent family matter, Travis has had to return home to the States." Three of their U.K. shows were postponed as a result.

In June, the Barkers announced with a literal drumroll and blue streamers that they were expecting a baby boy, as shared in an Instagram video.

Earlier that month, the Poosh founder and "Keeping Up With the Kardashians" star made a grand gesture out of her pregnancy reveal by holding up a sign that read "Travis, I'm pregnant" during a Blink-182 show in Los Angeles. The reveal was a nod to the band's music video for their 1999 song "All The Small Things."

Kardashian Barker shares kids Mason, 13, Penelope, 11, and Reign, 8, with ex Scott Disick. Barker shares kids Landon, 19, and Alabama, 17, with ex Shanna Moakler (Barker was also stepfather to Moakler's daughter with Oscar De la Hoya, Atiana, 24).

Keeping up with the Barkers: Kourtney Kardashian and Travis Barker's relationship timeline

Kourtney Kardashian, Travis Barker's fertility journey before pregnancy

Kardashian and Barker's desire to grow their family has been chronicled on her family's reality show, Hulu's "The Kardashians."

In Season 2, the couple went through in vitro fertilization treatment and talked openly about trying to have a baby together. The next season, Kardashian revealed they had stopped trying IVF, opting to let pregnancy happen naturally.

"We are officially done with IVF (in vitro fertilization)," Kardashian said in a confessional. "We would love a baby more than anything, but I really believe in what God has in store for us. If that's a baby, I believe it will happen."

Travis Barker, Kourtney Kardashian share 'scary' details of his life-threatening pancreatitis

Contributing: Anika Reed, USA TODAY

This article originally appeared on USA TODAY: Kourtney Kardashian had fetal surgery to save her, Travis Barker's son