Robert and Karen Capato’s twins were born in 2003 — 18 months after Robert Capato’s death. And in its first review of “posthumous conception,” the ­Supreme Court on Monday struggled to align modern reproductive techniques to a federal law written in 1939.

In the end, the justices generally sounded disinclined to award Social Security survivor benefits to the Capato children. Theirs is among about 100 cases brought by children of artificial insemination born after the death of a father that the Social Security Administration has turned down.

But it was a tough slog through the details of a law that was written at a time when, as Justice Samuel A. Alito Jr. said, “they never had any inkling about the situation that has arisen in this case.”

The Capatos married in 1999, and shortly thereafter he was diagnosed with esophageal cancer. Because they feared that his treatments might leave him sterile, Robert Capato began depositing sperm at a sperm bank in Florida.

He rallied at one point, and the couple had a naturally conceived son in 2001. But as his condition worsened, the Capatos began to talk about in vitro fertilization to give their son siblings. They signed a notarized statement that any children “born to us, who were conceived by the use of our embryos” shall in all aspects be their children and entitled to their property.

Trays of printed social security checks wait to be mailed from the U.S. Treasury's Financial Management services facility in Philadelphia. The Supreme Court justices generally sounded disinclined to award Social Security survivor benefits to the Capato children, who were conceived through artificial insemination after their father died. (Bradley C. Bower/AP)

But the provision was not included in Robert Capato’s will at his death in March 2002.

After the twins were born, Karen Capato applied for Social Security survivor benefits. The Capatos’ naturally conceived son received the benefits; the twins did not. The administrative-law judge said the 1939 federal law looked to state laws to determine whether the benefit seeker is eligible to inherit property, and under Florida law, the twins were not eligible.

An appeals court reversed that decision, saying that the twins only had to meet the definition in another part of the law, which defined an eligible child simply as “the child or legally adopted child of an individual.”

But other appeals courts have found just the opposite, that the state laws are the places to look for determination of eligibility.

Assistant Solicitor General Eric Miller acknowledged that the law was ambiguous, because it seemed to provide two different definitions of a “child.” But he said the Social Security Administration had made the reasonable ­decision to require that a person seeking survivor benefits “must show that he or she would have been able to inherit personal property” under applicable state laws.

Alito seemed most skeptical of the government’s position, saying that perhaps Congress in 1939 did not think there was need to define the meaning of child. “They knew what a child was,” he said.

Charles A. Rothfeld, representing Capato, said the law was clearly meant to cover “the biological child of married parents” and the twins fit that definition.

What about a child born into a marriage but not a biological child, asked Justice Sonia Sotomayor. She wondered what would be the outcome if Karen Capato remarried but used her deceased husband’s frozen sperm to conceive.

Justice Ruth Bader Ginsburg pressed Rothfeld on whether the marriage between the Capatos ended with his death.

Justice Antonin Scalia wondered how children could be “survivors” if they were not conceived before their father’s death.

“What is at issue here is not whether children that have been born through artificial insemination get benefits,” Scalia said. “It’s whether children who are born after the father’s death get benefits.”

Chief Justice John G. Roberts Jr. noted that the court’s precedents say that when a statute is ambiguous, the courts should defer to the federal agency.

“Is there any reason we shouldn’t conclude based on the last hour that it’s at least ambiguous?” Roberts asked.

“It’s a mess,” piped in Justice Elena Kagan.

“I think the problem is that we’re dealing with new technologies that Congress . . . wasn’t anticipating at the time,” Rothfeld replied.

The case is Astrue v. Capato .