Kourtney Kardashian needed emergency fetal surgery because her baby had "fluid in his lungs".
The 45-year-old reality star - who welcomed their son Rocky into the world seven months ago - has opened up on the "super rare" health struggles her baby was going through during her pregnancy at the time of the procedure in September last year.
Speaking on this week's episode of 'The Kardashians', she said: "We had a terrifying scare.
"It's super rare — the condition that he had — but it's also super rare and lucky that we caught it. Thank you, God, for a successful surgery.
"I'm honestly just so grateful, I have no words."
The operation was a success, but Kourtney was "filled with fear" in the aftermath, and even more so when the symptoms returned.
She recalled: "The fluid in his lungs actually did start coming back.
"Then I watched this documentary called 'Heal' that was all about the power of positive thinking and how our thinking can really affect our health."
Kourtney's outlooked changed as she decided to remain positive for the future.
She explained: "I started talking to the baby every day, saying my prayers.
"After I had that mindset shift, the fluid was completely gone and we had not one single problem after."
However, her husband Travis was still concerned right up until Rocky was born, and he wanted everything to be "perfect".
During the episode, he told Kourtney on their way to hospital: "I don't want him to come out early. I want to make sure his lungs are perfect - everything's perfect."
Thankfully, their baby boy was born on November 1, and the mother has been overjoyed with life as a parent.
She said: "It's everything I've ever dreamed of. Everything we've been through to get to this moment, it just feels so surreal...
"I'm so happy in my blissful baby bubble and the love with Rocky."
Tagged in Travis Barker Kourtney Kardashian