A lesbian couple is distraught, after a Utah juvenile judge ordered their baby to be taken away and given to a heterosexual couple.

The Associated Press reports April Hoagland and Beckie Peirce will attempt to challenge the ruling, made my Judge Scott Johansen on Tuesday in Price, Utah.

The couple believes their sexual orientation played a significant role in the judge's decision.

Hoagland and Peirce were legally allowed to become foster parents after the U.S. Supreme Court declared same-sex marriage to be legal in 2014. The couple were approved after a series of interviews, inspections and background checks by the Utah Division of Child and Family Services (DCFS).

However, during a routine hearing, Judge Johansen determined that the baby girl would be better suited in a different home, citing "a myriad" of studies in support of his claim.

"We are shattered," Hoagland told the Salt Lake City news outlet KUTV. "It hurts me really badly because I haven't done anything wrong."

The couple's attorney is reviewing their options to challenge the decision. The DCFS has been alerted as well.

By all accounts, the 1-year-old infant had been well taken care of by the couple since they acquired her three months ago. The couple are also raising Peirce's biological children, aged 12 and 14.

The baby's biological mother was enraged by the decision, according to her attorney Mandie Torgerson. She supported Hoagland and Peirce as foster parents.

Presidential candidate Hillary Clinton tweeted her support for the couple.

Utah DCFS Director Brent Platt said the agency must comply with the judge's decision, but would also look into the legality of the baby's removal. He added that the DCFS does not keep track of same-sex married couples, and the priority was to find suitable homes for the state's 2,600 foster children.

"Any loving couple if they are legally married, and meet the requirements, we want them to be involved," Platt said.