The Arizona Supreme Court ruled Thursday that a woman – who has since become infertile after surviving an aggressive form of cancer – may not use the embryos she had frozen before treatment to have a baby without her ex-husband’s consent and must donate them instead.

UTAH BECOMES 19TH STATE TO BAN LGBTQ CONVERSION THERAPY ON CHILDREN UNDER 18

Ruby Torres, 39, decided to have her eggs fertilized in 2014 after she was diagnosed with bilateral breast cancer and was told by an oncologist that chemotherapy would likely make her infertile. John Terrell, her boyfriend at the time, initially declined to serve as a sperm donor but eventually agreed, AZ Central reported, citing court documents.

The couple signed an agreement at a fertility clinic that stated, should they split up, the embryos would not "be used to create a pregnancy without the express, written consent of both parties." The couple married days after signing the contract, but divorced three years later in 2017.

During their divorce proceedings, Terrell asked the Maricopa County Superior Court to prevent Torres from having the embryos implanted. He said he no longer desired to become a father to children he’d be financially responsible for. The court sided with him and ordered the embryos to be donated.

The Arizona Court of Appeals overturned that decision in March, ruling that Torres' rights to have children prevailed over her ex-husband’s objections to becoming a parent.

The back-and-forth court battle inspired a bill in the Arizona State Legislature allowing a former spouse to use the embryos against their former partner's wishes, but relieves the ex-spouse of parental responsibilities like child support. It became law in 2018, but was not retroactive to include past cases. The Center for Arizona Policy, a social conservative group that lobbies for religious freedom and anti-abortion policies, had lobbied the state legislature on Torres’ behalf.

“I’m heartbroken for Ruby Torres today,” Cathi Herrod, the group's president, said in a statement after Thursday’s ruling. “It’s a sad day that she will not be able to bring her children to birth and raise them as she so desired.”

On Thursday, the Arizona Supreme Court upheld the couple’s initial contract, which determined that both parties must consent in order for Torres to use the embryo to become pregnant. The high court, serving with only five of seven justices, unanimously agreed that the embryos should be donated to a third-party.

“We are cognizant of the unavoidable emotional fall-out attendant to the disposition of the embryos here,” Justice Ann Scott Timmer wrote in the ruling. “But the family court was required to enforce the parties’ chosen disposition of the embryos as set forth in the Agreement.”

CLICK HERE TO GET THE FOX NEWS APP

"This was a case that, once you took all the emotion out of it, hinged simply on contract law," Terrell’s attorney, Claudia Work, told the Phoenix Times. "It's a cautionary tale to clinics to be careful on their phrasing. It was clear that the only options available to the trial court were to enforce the contract and donate in this situation."

The Associated Press contributed to this report.