Melanie Capobianco sat alone at the computer in her Charleston, S.C., home Tuesday morning, not for the first time, anxiously searching among the weighty decisions being issued by the Supreme Court for the one that matters most to her.

All of the sudden, there it was: Adoptive Couple v. Baby Girl , the case that could determine whether she would ever live again with the little girl she had raised for the first 27 months of her life.

She was confused by the words, at first, and a little unsure. Then e-mails poured in and lawyers called and then there was one phone call she had to make — to her husband, Matt, at work.

All she could think to say was this: “We won.”

For now, at least. The Supreme Court ruled 5 to 4 that the Indian Child Welfare Act did not command that custody of “Baby Veronica,” as she has become known, must remain with her birth father, Dusten Brown, with whom she has lived for the last 18 months of her life.

Matt and Melanie Capobianco are pictured with Veronica, a girl they are trying to adopt, in this undated family handout photo provided by Fiddler Law Office representing the Capobiancos. (HANDOUT/REUTERS)

The court sent the case back to lower courts and, as has been the case for all her young life, more judges will determine which of the adults who love Veronica will be allowed to care for her.

And just as there was joy in Charleston, there was disbelief in Nowata, Okla., where Baby Veronica, who will soon outgrow her Internet name, lives with Brown and his new wife.

“I would say devastated is a good word to use,” said Chrissi Nimmo, assistant attorney general for the Cherokee Nation.

The case has drawn national attention. The Capobiancos were ordered by the South Carolina Supreme Court in 2011 to turn over the girl to the Native American father who once gave up rights to her but now has embraced parenthood.

But Justice Samuel A. Alito Jr., writing for the majority, said the ICWA did not require that outcome.

Congress passed the law in 1978 to discourage adoptions outside tribes, erecting high hurdles for ending Indians’ parental rights. Lawmakers sought to end what they found to be a shameful practice of removing Indian children from their families and tribes to place them in foster care and with non-Indian families.

But the law does not apply, Alito said, when “the parent abandoned the Indian child before birth and never had custody of the child.”

He said the act was designed to “preserve the cultural identity and heritage of Indian tribes,” not “put certain vulnerable children at a great disadvantage solely because an ancestor — even a remote one — was an Indian.”

Although the majority agreed that Veronica is considered an Indian child under the law, the opinion pointed out several times that she is only 3/256th of Indian descent.

Brown did not want to comment, his lawyers said, but his supporters vowed the fight is not over.

“My heart, and no doubt the hearts of all of Indian Country, goes out to Dusten, our fellow Cherokee citizen, and his entire family,” Cherokee Nation Principal Chief Bill John Baker said in a statement. “Everything this family has gone through the past few years, just to keep his biological child — HIS baby girl — is more overwhelming than any of us can imagine.”

The saga began in December 2009 when Brown and Veronica’s birth mother, Christina Maldonado, became engaged. She learned a month later that she was pregnant. But she called things off after Brown pressured her to get married right away, and he later told her via text message, in response to her question, that he would rather give up parental rights than pay child support.

Maldonado decided to place the baby for adoption. The Capobiancos met the mother through an adoption agency, supported her in her last months of pregnancy and were in the delivery room when she gave birth. They named Veronica and brought her to their home in Charleston, S.C.

Brown, who was in the Army at the time, learned just before he was about to ship out to Iraq that the child had been placed for adoption. He immediately tried to stop the process and, as a member of the Cherokee Nation, invoked the ICWA.

A family judge and then the South Carolina Supreme Court ruled that the ICWA meant Brown’s parental rights could not be terminated and the adoption could not go through. The Capobiancos turned over the child on New Year’s Eve, 2011.

Alito’s opinion that the ICWA did not apply in the case was joined by Chief Justice John G. Roberts Jr. and Justices Anthony M. Kennedy, Clarence Thomas and Stephen G. Breyer.

The Obama administration, child welfare groups and a number of states had sided with Brown. Indian advocates said they were relieved that the court majority did not call the law itself into question, only its application in this case.

Justice Sonia Sotomayor accused the majority of turning the law upside down in order to reach the result it wanted. She said the point of the law was to keep Indian children with their parents and to make adoptions outside the tribe less likely.

“The majority may consider this scheme unwise,” she said. “But no principle of construction licenses a court to interpret a statute with a view to averting the very consequences Congress expressly stated it was trying to bring about.”

Sotomayor was joined by Justices Antonin Scalia, Ruth Bader Ginsburg and Elena Kagan.

She said it was not “foreordained” that the child be returned to the Capobiancos. She said the girl’s paternal grandparents, or another member of the Cherokee Nation, may apply to adopt her.

But, she said, “it can be said with certainty that the anguish this case has caused will only be compounded by today’s decision.”

Meeri N. Kim contributed to this report.