A 15-minute old Californian newborn was hooked to a tiny pacemaker that saved her life from a rare but fatal heart defect, doctors announced on Monday.

Doctors at Stanford University's Lucile Packard Children's Hospital had diagnosed Jaya Maharaj with congenital heart block, a rare condition that blacks normal electrical pulses from getting to the heart to produce a heartbeat and prevents newborns’ hearts from making critical rhythmic changes, like increasing during feeding and decreasing during sleep.

Jaya, who had been born nine weeks early, would have only have had hours to live if surgeons, who said that the unborn infant had an abnormally low heart rate of 45 beats per minute instead of a normal 120 to 150 beats per minute, did not perform the surgery.

The doctors said that the 3.5-pound baby was smaller than any pacemaker recipient ever documented in medical literature.

Doctors hailed Jaya’s surgery as remarkable not because of her tiny size, but because many unborn infants with her condition do not survive pregnancy. Experts said that 20 to 50 percent of patients diagnosed with the heart condition prenatally die in utero or in the first weeks after birth.

Surgeons had acknowledged that there were risks associated with premature delivery to surgically implant the pacemaker, and the doctors involved in the surgery had to weigh the conflicting risks.

“We knew that at any time the baby’s heart could give out,” said neonatologist Valerie Chock, a member of the large, multidisciplinary team that planned Jaya’s birth and surgery in Stanford press release. “We had to decide: At what point do we deliver to balance that risk against the risk of premature delivery?”

“So much was in the balance,” said Dr. Yasser El-Sayed, the Packard Children’s high-risk obstetrician who oversaw Leanne’s care during pregnancy in the news release. “We just had to take it day by day, week by week.”

Jaya’s mother, Leanne Maharaj who is Hindu said that whenshe and her husband found out about their unborn daughter’s condition they prayed every day to have faith and hope that something would help.

Leanne had to be checked twice a week before the baby was born to monitor its heart rate and growth as well as looking for fluid around her heart and lungs, and the mother was given a steroid medication to minimize continued damage to the baby’s heart.

Leanne was wheeled into the operating room on Nov. 22 where 25 clinicians waited to perform her cesarean and to stabilize the newborn, and another team of doctors were in an adjacent operating room preparing for the baby’s surgery.

Leanne remembered that it was a quick delivery and that when the baby had come out she and her husband started crying.

Jaya had been promptly taken to the operating room next door where doctors had proceeded to cautiously implant the pacemaker in her upper abdomen with just eight stitches, which raised to normal by the time she was two hours old.

Jaya spent six weeks in the Neonatal Intensive Care Unit after the procedure and was able to go home on Jan. 12. Jaya’s prognosis was excellent, but doctors said that her pacemaker leads must be repositioned occasionally as she grows older and she will need new pacemaker batteries every five to seven years.