The miracle of life was put to the test and then some for one new mother.

Earlier this year, a Missouri City, Texas woman died, gave birth and then came back to life in a story that proves happy endings can happen when you least expect it.

High school teacher Erica Nigrelli was 36 weeks pregnant when she passed out and her heart stopped beating while in a fellow teacher's classroom. Co-workers performed CPR and got a defibrillator to get it pumping. Thankfully, paramedics arrived to whisk her away to a hospital where she gave birth to daughter Elayna via C-section.

Here's the (even more) mind-blowing aspect of the story: Erica's heart was not actually beating when she gave birth to Elayna, meaning it goes down as a post-mortem delivery.

Amazingly, both mother and daughter wound up surviving the ordeal. As it turns out, Erica, 32, has a heart defect that was not discovered until that fateful day and she could have easily have died on the spot. She has since been given a pacemaker.

Elayna, now a nine-pound three-month-old, could be taken off oxygen any day. As Erica says, "She's just a baby. A normal baby."

As for the people who acted quickly to save Erica, she couldn't be more grateful, saying, "Thankful is not a strong enough word for what they've done for us."

Watch Erica's amazing story below.

More From WFNT