SALT LAKE CITY — A Utah judge reversed his decision to take a baby away from her lesbian foster parents and place her with a heterosexual couple after the ruling led to widespread backlash.

Judge Scott Johansen signed an order, which was released Friday, that will allow the 9-month-old baby to stay with April Hoagland and Beckie Peirce, a married couple who live in the city of Price.

Utah foster parents April Hoagland and Beckie Peirce via KSL

It comes after Johansen said in court Tuesday that the baby would be removed from the couple's home. Utah officials and the couple filed court challenges demanding the judge rescind the order.

In his first decision, Johansen cited research that shows children do better when raised by heterosexual families. However, the American Psychological Association has said there's no scientific basis that gay couples are unfit parents based on sexual orientation.

Messages left with Jim Hunnicutt, a lawyer for the couple, and the Utah Division of Child and Family Services seeking comments on the judge's revised order were not immediately returned Friday.

Hoagland and Peirce are among a group of same-sex married couples who were allowed to become foster parents in Utah after last summer's U.S. Supreme Court ruling that made gay marriage legal across the country. State officials don't keep an exact count but estimate there are a dozen or more foster parents who are married same-sex couples.

A full transcript of Johansen's initial ruling has not been made public and may not be because court records of cases involving foster children are kept private to protect the kids. Johansen is precluded by judicial rules from discussing pending cases, Utah courts spokeswoman Nancy Volmer has said.

The move to take the baby away generated widespread criticism, including from national gay rights groups and Utah Gov. Gary Herbert.

Herbert said Thursday that Johansen should follow the law and not inject his personal beliefs into the decision. Groups including the Anti-Defamation League, Human Rights Campaign and the American Civil Liberties Union called the order shocking, outrageous and unjust.