Kourtney Kardashian is thanking her medical team for "saving our baby's life" after she revealed she was hospitalized with complications from her pregnancy. 

Kardashian posted a black-and-white photo of her hand holding husband Travis Barker's while she was in a hospital bed with an IV in her arm. The picture also showed a glimpse of her pregnant belly with a Band-Aid on it.

"I will be forever grateful to my incredible doctors for saving our baby’s life," she wrote in the caption. "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."

The 44-year-old is expecting her first child with the Blink-182 drummer. Kardashian is already a mom to three children — Mason, Penelope and Reign — with ex-boyfriend Scott Disick. Barker also shares two children, Alabama and Landon, with ex-wife Shanna Moakler. 

KOURTNEY KARDASHIAN EXPLAINS HER DECISION TO STEP AWAY FROM 'TOXIC ENVIRONMENT' ON 'KUWTK'

Kourtney Kardashian and Travis Barker inset with black and white hospital picture

Kourtney Kardashian thanked her husband, Travis Barker, for being at her side while she was hospitalized with pregnancy complications. (Kourtney Kardashian Instagram/Getty)

APP USERS CLICK HERE

"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," she continued in her caption. "I have a whole new understanding and respect for the mamas who have had to fight for their babies while pregnant.

"Praise be to God. Walking out of the hospital with my baby boy in my tummy and safe was the truest blessing."

Kourtney Kardashian and Travis Barker pose

Kourtney Kardashian says she has a new respect for moms who "have had to fight for their babies." (Getty Images)

Barker took to his account on X, formerly Twitter, to share his gratitude, as well.

"God is great. I flew home for a life-threatening emergency surgery for our baby that I’m so grateful went well," he wrote.

He also thanked fans for their support after having to cancel shows last week in Europe with Blink-182, assuring them, "Tour resumes Friday."

HOW DID TRAVIS BARKER AND KOURTNEY KARDASHIAN MEET? THE DRUMMER SAID 'I DO' TO THE REALITY STAR IN 2022

Travis Barker and Kourtney Kardashian appear on the red carpet

Kourtney Kardashian and Travis Barker are expecting their first child together. (Getty Images)

Hours before announcing the canceled shows last week, Barker also took to his Instagram Stories to share several photos of a prayer room. 

The first photo was outside the prayer room with a sign that said "All welcome." He also posted a photo inside the room with a large stained-glass window. His last photo was a blue banner that said, "Together we pray." 

CLICK HERE TO SIGN UP FOR THE ENTERTAINMENT NEWSLETTER

Kourt and Travis at the Met Gala

Barker and Kardashian were married in a lavish Italian ceremony last year.  (Dimitrios Kambouris/Getty Images for The Met Museum/Vogue)

CLICK HERE TO GET THE FOX NEWS APP

Earlier this year, Poosh founder Kardashian, who married Barker in Italy in 2022, surprised her husband with the news of her pregnancy at a Blink-182 concert, holding up a large poster in the crowd that said, "Travis I’m Pregnant," referencing the band's "All the Small Things" music video.

Fox News Digital's Stephanie Giang-Paunon contributed to this report.