A juvenile court judge in Utah who drew criticism for removing a foster child from the home of a lesbian couple has recused himself from the case.

Apparently agreeing to a motion filed by the couple, Judge Scott Johansen issued an order Monday that he “hereby disqualifies himself from this case and refers all pending matters to the Presiding Judge.”

Johansen, a juvenile court judge in eastern Utah, had drawn the ire of gay rights activists and others, including former secretary of state Hillary Clinton, for removing the 9-month-old baby from the home of Beckie Peirce and April Hoagland, who had fostered the child for three months. The couple was seeking to adopt the child.

Last week, Johansen ordered that the girl be removed from the home instead and placed with a heterosexual couple within seven days, citing research that suggested the girl would do better in a home with a father and a mother. Leading medical organizations such as the American Academy of Pediatrics, however, have said children do just as well in homes with same-sex parents.

The state’s Division of Child and Family Services objected to the order, and the state’s Republican governor also cited concerns that Johansen’s order was not lawful. After the outcry, Johansen put a stay on his order, setting a date in December for a hearing to determine the child’s best interests.

But on Monday, the judge decided to heed calls to remove himself from the case.

“We are thankful that Judge Johansen has decided to step aside. Our greatest concern now is taking care of our beautiful baby foster daughter. We are grateful for the outpouring of love and support from people all across the nation. We are grateful that our family is now being treated equally under the law.” Peirce and Hoagland said in a statement released by the LGBT rights group Equality Utah.

Troy Williams, the executive director of the group, said, “We applaud Judge Johansen for recusing himself from this case. LGBT parents love and adore their children with as much devotion as our heterosexual counterparts. Sexual orientation should never be a barrier to raising a loving family.”

This report has been updated.