
47 Wn.2d 409 (1955)
287 P.2d 1001
In the Matter of the Application for Writ of Habeas Corpus by JOHN L. SCHREIFELS, Respondent,
v.
VIOLET SCHREIFELS, Appellant.[1]
No. 33261.
The Supreme Court of Washington, Department One.
September 15, 1955.
*411 Felix & Abel, for appellant.
Robert C. Bibb, for respondent.
SCHWELLENBACH, J.
This is an appeal from a judgment granting a writ of habeas corpus to the father of three minor children and awarding their care, custody and control to him as against their mother.
John and Violet Schreifels were married at Wallace, Idaho, on August 9, 1948. At that time, she was fifteen years old. Shortly prior to the marriage, she had given birth to an illegitimate child. John, who was not the child's father, gave the boy his name and acted as a foster parent. However, John did not adopt the boy nor acknowledge him to be his child. Three children were born to the couple as the issue of the marriage  John, aged five years, Elizabeth, aged three years, and Thomas, aged two years.
In September, 1949, John's brother, Anthony, came to live with him. A love affair developed between Anthony and Violet, with the result that they commenced having sexual relations. Finally, on November 14, 1952, Anthony and Violet left, taking the four children with them. They lived together as husband and wife in various cities in California, Oregon, and Washington, keeping their whereabouts from John, who was looking for them. Two children were born to them during this period. In July, 1954, in Shoshone county, Idaho, John commenced a divorce action against Violet. The summons and complaint were served by publication. Violet was not personally served. At no time during the pendency of the action have the children been within the state of Idaho. In the divorce cause, on November 29, 1954, an order was entered granting to John the full custody, care, and control of the minor children.
John finally found Anthony and Violet and the children living in a one-room house in Snohomish county, in November of 1954, and a petition for a writ of habeas corpus was filed on December 3, 1954. (The order of the Idaho *412 court awarding him the custody of the children was apparently obtained after he learned of their whereabouts.)
The petition alleged that Violet left with Anthony, taking the children with her; "That they have been openly, lewdly, adulterously and viciously cohabiting as husband and wife in the presence and company of said minor children;" that they were keeping the children in a condition of poverty, squalor, and filth; "that said children are being restrained in connection with an adulterous and lewd relationship, and that said children are being restrained under physical and moral conditions gravely injurious to them." The petition also alleged the entry of the order in the divorce action awarding the custody of the children to the petitioner.
Two ladies who were members of the Grange testified that, as part of a Grange project, they visited the home in Snohomish county on four different occasions; that the children were warmly dressed and were clean; that there was no sickness; that the house was warm; and that the children were well behaved and very happy.
Both Violet and Anthony freely admitted their adulterous relationship, not only after, but before they left Idaho. According to them, it was something which they could not overcome. They could see nothing particularly wrong with it. Violet testified that she would take the children and go to her sister in Montesano and wait for a divorce, in order that they could be married, and that in the meantime Tony would stay and fix up the house. The trial judge apparently did not believe her.
The trial court denied the petition for a writ on behalf of Roy, the child born to Violet before the marriage, for the reason that the child had never been adopted by the petitioner and a writ of habeas corpus, in cases of this nature, is based upon parental rights. The court held further that the order of the Idaho court granting custody to the petitioner was not entitled to full faith and credit, for the reason that it did not have jurisdiction over the children at the time of the entry of the order. A writ was granted as to the three children of the marriage between John and Violet, and their immediate care, custody, and control was given to the petitioner. *413 In his oral decision at the close of the hearing, the judge said that the children had received excellent physical care from Violet. He found John to be "a law-abiding, decent citizen, is God-fearing, active in his Church and an entirely worthy man." As to the issue involved, he said:
"On the broader issue as to the powers of this court in this writ of habeas corpus, I have little doubt of that, that this court has the power to enforce parental rights of either one or both of these parties, for certainly John Schreifels, the father, has no standing in this court except on a writ of habeas corpus and can not invoke the jurisdiction of this court except on such a writ. He certainly has parental rights that can be enforced.
"In choosing between this home where this open adultery has been committed over a period of years, and the father, who, the court is convinced, to the best of his ability will take care of these children, there is really no choice. The mother is absolutely unfit, if our moral principles have any validity at all. The children would not suffer any neglect, physical neglect, from her and would not, perhaps, suffer in their moral environment for a couple of years more, but these children are going to know that Anthony is not their father."
Our first problem is to determine whether or not the petition alleged facts sufficient to authorize the court to issue a writ of habeas corpus. RCW 7.36.030 sets out the requirements for such a writ:
"Application for the writ shall be made by petition, signed and verified either by the plaintiff or by some person in his behalf, and shall specify:
"(1) By whom the petitioner is restrained of his liberty, and the place where (naming the parties if they are known, or describing them if they are not known);
"(2) The cause or pretense of the restraint, according to the best knowledge and belief of the applicant;
"(3) If the restraint is alleged to be illegal, in what the illegality consists."
RCW 7.36.020 provides:
"Writs of habeas corpus shall be granted in favor of parents and guardians, to enforce the rights and for the protection of infants and insane persons; and the proceedings shall in all cases conform to the provisions of this chapter."
*414 [1, 2] The writ of habeas corpus is frequently resorted to, to obtain the custody of children, and quite often to determine the rights of parties to their custody. The office of the writ is not to recover their possession, but to free them from illegal restraints upon their liberty. The detention of a child of tender years from one entitled to its custody is an illegal restraint within the law. 1 Bailey on Habeas Corpus 574, Custody of Children, § 145. Only those having a legal right to a child may seek its custody by habeas corpus. In re Stuart, 138 Wash. 59, 244 Pac. 116.
[3] When parents have separated and are living apart, and neither of them have been deprived by court order of the custody of their children, they both have a legal right to such custody. However, if the children are of tender years, the paramount right to their custody is in the mother, provided she is morally fit. This question rests within the sound discretion of the court.
We have many times recognized that habeas corpus proceedings may be brought in connection with the custody of children. See In re Smith, 118 Wash. 1, 202 Pac. 243, wherein a father sought a writ as against the grandparents; In re Penner, 161 Wash. 479, 297 Pac. 757, wherein a husband, awarded custody of the children by a divorce decree, sought a writ as against the mother; In re Gordon, 19 Wn. (2d) 714, 144 P. (2d) 238, a proceeding by the parents against a probation officer; Fitzgerald v. Leuthold, 30 Wn. (2d) 402, 192 P. (2d) 371, wherein the father sought habeas corpus as against third parties; In re A Minor, 39 Wn. (2d) 744, 238 P. (2d) 914, wherein we recognized habeas corpus as the proper remedy where the father alleged that the child was wrongfully taken from his possession by the mother and turned over to third parties; and In re Ward, 39 Wn. (2d) 894, 239 P. (2d) 560, wherein parents sought custody by writ of habeas corpus from grandparents.
[4] In this case, in order to warrant the issuance of a writ and a hearing thereon, it was incumbent on the father to make a prima facie showing of a legal right to the custody of the children, paramount to the right of the mother to their custody. Here, petitioner made such a prima facie *415 showing. He was the natural father of the children and had not been legally deprived of their custody. He alleged that the children were being restrained in connection with a lewd and adulterous relationship. Surely that was sufficient to warrant an inquiry by the court. In fact, a court would be derelict in its duty if it ignored and refused to hear allegations of that sort involving young children.
[5] Once the writ is issued, the court is then faced with the problem of custody and in that respect the best interests and welfare of the children controls. Proper disposition of the children's custody rests within the court's discretion. Lovell v. House of the Good Shepherd, 14 Wash. 211, 44 Pac. 253. Two principles, the welfare of the children and the right of the parent or parents, must be considered together, and the former is considered to be the more weighty. In re Day, 189 Wash. 368, 65 P. (2d) 1049.
The court found that petitioner is in good health, is steadily employed and has a sufficient income to support the children, has made adequate plans for their care during his working hours, is a member of the local Catholic church, is a scout master, and is a fit and proper person to have the care, custody and control of the children. The record fully warrants the above finding.
The court found that, by her conduct and relations with petitioner's brother, the mother has demonstrated that she is morally unfit to have the custody of the children, and that, for their best interests, particularly their moral and spiritual upbringing, the petitioner should be awarded their care, custody and control.
John is a devout Catholic and is greatly concerned about the children's spiritual training and welfare. Violet admitted that they had not attended church, but indicated that the children were getting religious training at home. It occurs to us that this home would not be the ideal locale for religious training.
If the mother were a fit and proper person to have the custody of the children and should insist on bringing them up in a faith different from that of the father, no matter how sincere he may be in his religious beliefs, that fact *416 alone would not warrant a court, in a habeas corpus proceeding, in taking their custody from the mother and awarding it to the father. But here, the children are not being given religious training in any denomination, and that fact should be considered, together with the mother's misconduct, in awarding custody.
[6] Appellant relies upon a supposed distinction between "grande passion" and common, promiscuous adultery, citing Christian v. Christian, 45 Wn. (2d) 387, 275 P. (2d) 422, and Freeland v. Freeland, 92 Wash. 482, 159 Pac. 698. Adultery, whether promiscuous or not, violates one of the Ten Commandments and the statutes of this state. We have been unable to find where the state of Washington has approved or condoned "grande passion." Each case must be decided on its own facts. Here, the parties have followed a course of conduct which commenced in petitioner's home. The mother has either failed, or never attempted, to curb her lustful passion. These innocent children should not be required to live in such surroundings. The trial court did not abuse its discretion in awarding the custody of children to the petitioner.
[7] In her return to the writ, the mother alleged that the four children named in the writ resided with her, and were healthy and happy children; and that she was a suitable and proper person to have their custody, care, and welfare. The petitioner did not file a reply to the return. Appellant urges that the allegations of the return were thereby admitted, and that therefore the issue of the welfare and custody of the children was not raised. The return did not deny, nor did it allege facts to dispute, the allegations in the petition that the mother and brother of the petitioner were openly, lewdly, adulterously, and viciously cohabiting in the presence of the children. Under the allegations of the petition and the return, the issue of the welfare and custody of the children was before the court.
[8] It appears that counsel for appellant was given only three hours' notice of the time of presentation of the proposed findings and conclusions. Error is assigned on the failure to comply with Rule 15, General Rules of the Superior *417 Courts, 34A Wn. (2d) 116, as amended, effective March 27, 1952, which states:
"Unless an emergency is shown to exist, the court will not sign findings of fact and conclusions of law until the defeated party or parties shall have had three days' notice of the time and place of the submission thereof, and shall have been served with copies of the proposed findings and conclusions."
When objection was made to the early presentation, the court ruled that an emergency existed. The court, sitting throughout the hearing, and observing the attitudes of the parties, no doubt had in mind the fact that the children had once been spirited away by the mother, and that she, aided by her sister, with whom she indicated she and the children would temporarily reside, had concealed from the father their whereabouts for over two years. The trial court undoubtedly felt that there was a strong possibility of a hasty departure from the jurisdiction by the mother and the children.
It is within the discretion of the trial court to determine if an emergency exists, and in the absence of anything to the contrary, it will be presumed that the trial court properly determined that an emergency existed. Hub Mercantile Co. v. Stingle, 119 Wash. 607, 206 Pac. 567. Under the facts of this case, the finding of an emergency will not be disturbed.
The judgment is affirmed.
HAMLEY, C.J., DONWORTH, FINLEY, and OTT, JJ., concur.
NOTES
[1]  Reported in 287 P. (2d) 1001.
