A brain-dead Brazilian woman, pregnant with twins, was kept alive for 123 days — the longest time ever — so she could deliver her babies.

Frankielen da Silva Zampoli Padilha, 21, was left brain dead in October after suffering a stroke, according to Caters News. Her twins, a boy and a girl, were delivered via emergency caesarean section in February at seven months, according to their father Muriel Padilha.

Padilha, 24, said doctors made the ground-breaking decision to try and save the embryos after originally believing their lives were doomed.

“They said as soon as their little hearts stopped beating, they would turn off the gadgets and I would be able to bury my wife,” he said.

But the twins’ hearts kept going.

“Frankielen’s organs were all intact and working as if she was still with us. We took the decision to keep her alive to save her unborn children. And every day we watched them grow normally,” Dr. Dalton Rivabem, the head of the Neurological ICU at Nosso Senhora do Rocio hospital in Campo Largo, South Brazil, who was responsible for the case, said.

Padilha, who also has a 2-year-old daughter, recalled his wife’s last hours in October.

He was on his way to his job as a farmer, when Frankielen called, begging him to come home because her head was hurting her and she felt she was going to collapse.

He found her shaking, crying, dizzy and vomiting from the pain.

“As I drove her to the hospital she said ‘I want you to be prepared to accept this because I will be staying there, I won’t be coming home,’” he recalled. “Those were the last words she spoke to me and the last time I saw her alive,” he said.

The couple had been sweethearts for six years, since they were teenagers.

Doctors ensured that Frankielen’s body didn’t shut down by monitoring her every day, administering medications and measuring her blood pressure and blood flow.

“One of our main concerns was to keep the organ functions continual for the babies to grow and develop,” Dr. Rivabem said.

A slew of health-care professionals also cared for the twins, caressing their mother’s belly and singing and talking to the growing fetuses, to ensure they felt the affection their mother could not give.

“And we decorated the area around Frankielen’s bed. The ICU was filled with love, affection and encouragement for the babies and their family to succeed. We said, ‘we love you’ every day they were here,” Erika Checan, a chaplain and music therapist, said.

Rivabem admitted that everyone, including himself, cried when the twins were born.

“The success of this case was down to great teamwork and, of course, to a divine purpose,” he said.

Well-wishers across Brazil raised thousands of dollars to support the family and donated clothing and toys for the babies.

The twins were born at a typical weight for premature babies, Ana Vitoria coming in at 3 pounds and her brother Asaph at 2.8 pounds.

The newborns were kept in incubators for a couple of months and are now being taken care of by Frankielen’s mother, Angela Silva, while their father works.

“I’m so proud of my daughter,” Silva said. “It’s been hard losing her but she was a warrior right until the end, protecting her beautiful children and giving them life until the day she finally died.”

Padilha added, “Frankielen was a generous and loving person. I believe God chose her for this purpose so a miracle could happen.”