A Kentucky doctor who checked into the hospital to give birth to her own child found herself back on call, delivering the baby of another woman first after the patient had last-minute complications.

Obstetrician Amanda Hess was preparing to be induced for the birth of her second child when she and her husband heard distress cries from another patient in the hallway.

Hess recognized the woman, Leah Halliday Johnson, as someone she had examined a few days earlier at her medical practice. Hess was not the woman’s regular doctor, who was still on his way to the hospital.

And with the baby showing signs of distress, Hess did what came naturally.

“I said, ‘You know, I’m not on call. I’m here in a gown, but I think we ought to have the baby,’” she recalled in an interview with NBC News.

Halliday Johnson, who was about to deliver her fourth child, said she recognized Hess immediately but had no idea she was in the hospital as a patient herself.

“The clues were there. My husband noticed that she was in a hospital gown, but at that point I was so relieved to see one of my doctors that I was just ready to move it along,” she said.

Hess grabbed a second hospital gown to cover up and slipped some cloth booties over her flip-flops. Then she delivered Halliday Johnson’s daughter.

“The baby was great! Came out screaming and crying,” she said.

Hess hadn’t predicted she would be working on the day of her birth, although she had planned to work late into her pregnancy. In fact, she had delivered another baby the afternoon before.

“It was a 10 pound baby. I thought, this was the way to go out,” she said. “I thought, ‘A great big baby, I’m working up until the last minute!’ and then this came. I couldn’t have predicted this. This is definitely working until the very last second.”

Hess started the medication for her induction about an hour later. She immediately went into labor and delivered a healthy girl.

Halliday Johnson expressed gratitude for what Hess did.

“It just goes to show you what an amazing person she is, what an amazing woman and mother and doctor,” she said.

Hess said the two women haven’t met since their deliveries, but knows they will soon since Halliday Johnson is a patient at her practice. She also knows their daughters share “a special bond” because of the circumstances of their birth.

Hess also downplayed her actions, saying what she did was “definitely more instinctual” than worrying about her own condition.

“I’m definitely better at taking care of patients myself as opposed to being a patient so it was just natural to get back into doctor mode,” she said. “Delivering other peoples’ babies is something I do every day. And I’m more comfortable with delivering someone else’s baby than my own, for sure.”