The plaintiffs in error on January 17, 1959, instituted a habeas corpus proceeding in the Superior Court of DeKalb County for the custody of two minor children. In their petition they alleged: that they were the legal custodians of the two children by virtue of a contract, executed on March 16, 1958, in which the natural parents of said children relinquished all parental rights to them and gave said rights to the petitioners, together with a consent, executed on the same day, for petitioners to adopt the children; that they had not released their rights in the matter; and that the respondents were illegally restraining the children of their liberty and withholding them from the custody of the petitioners. The respondents in their answer alleged: that on August 22, 1958, they were summoned to the office of W. Pat Roberts, attorney, and were shown the two children and were asked if they would consider keeping said children because they had been abandoned by their natural parents, and that custody had been released to irresponsible parties who had brought them to Roberts’ office and stated that, because of their ill health and nervous temperament, they would not keep the children any longer, and that it was Roberts’ duty to see that they were placed. The respondents alleged that they took custody of the children on August 22, 1958, with the understanding that they could later adopt them; and that they had loved, cared for, maintained, and supported the children, and now desired to adopt them. They further answered that, because of the cruel and mean treatment of the children by the petitioners, and the intolerable conditions under which they were living, and by their acts and complete disregard for the support, maintenance, and welfare of said children, and because of their irresponsibility and desire to rid themselves of the children, the petitioners have abandoned and voluntarily released all rights to the children.
Error is assigned on the judgment of the trial court remand*287ing custody of the children to the respondents after a hearing.
“In all writs of habeas corpus sued out on account of the detention of the child, the court on hearing all the facts, may exercise its discretion in awarding custody of the child. Such discretion, however, is not arbitrary or unlimited, but is a dis^ cretion guided and governed by the rules of law. The power ought to be exercised in favor of the party having the legal right, unless the circumstances of the case would justify the court, acting for the welfare of the child, in refusing it.” McDowell v. Gould, 166 Ga. 670 (3) (144 S. E. 206). See Miller v. Wallace, 76 Ga. 479 (2 Am. St. Rep. 48); Monk v. McDaniel, 116 Ga. 108 (4) (42 S. E. 360); Day v. Hatton, 210 Ga. 749 (83 S. E. 2d 6); Johnson v. Johnson, 211 Ga. 791 (89 S. E. 2d 166). Where the evidence on the controlling issues is in conflict, the discretion of the trial judge will not be controlled. Williams v. Hicks, 149 Ga. 333 (100 S. E. 97); Shope v. Singleton, 196 Ga. 506 (2) (27 S. E. 2d 26).
In the instant case, the evidence being in conflict as to whether the petitioners had relinquished or abandoned their right to the custody of the children, and as to their standing as fit and proper parties to have custody of them, and the undisputed evidence showing that the respondents were fit and proper persons to have, custody of the children, it cannot be said that the trial judge abused his discretion in remanding custody of the children to the respondents. Awtrey v. Awtrey, 164 Ga. 69 (2, 3, 4) (137 S. E. 760); Butts v. Griffith, 189 Ga. 296 (2) (5 S. E. 2d 907); Fowler v. Fowler, 190 Ga. 453 (2) (9 S. E. 2d 760).
Judgment affirmed.
All the Justices concur.