
185 N.W.2d 879 (1971)
Diane L. REILAND, Appellant,
v.
Robert Kenneth REILAND, Respondent.
No. 42463.
Supreme Court of Minnesota.
April 2, 1971.
George O. Murray, Preston, Wm. J. Nierengarten, Austin, for appellant.
Price & Dunlap, Rochester, for respondent.
Heard before KNUTSON, C. J., and MURPHY, ROGOSHESKE, KELLY, and ODDEN, JJ.

OPINION
PER CURIAM.
Appeal by plaintiff-wife from judgment in a divorce action and an order directing that the father should have custody of the minor son and that the mother should have custody of the minor daughter. It is contended that this disposition was an abuse of the trial court's discretion. Minn.St. 518.17.
This is the second time this controversy has been before us. In the previous action, another trial court granted the divorce and awarded permanent custody of both children to the father. On appeal, we held in Reiland v. Reiland, 280 Minn. 444, 160 N. W.2d 30, that the equivocal evidence contained in the record relating to the wife's misconduct did not justify the court in depriving her of permanent custody of the two children without specific provision for her right of visitation, and we granted a new trial so that the merits of the wife's case might be more fully considered. The *880 facts relating to the breakup of the marriage and the general relationship of the parties are related in that opinion and need not be repeated here.
The evidence taken at the second trial was largely cumulative. The record contains a good deal of testimony concerning plaintiff's affair with one Glen Prochaska. After hearing the evidence, the trial court filed an order for partial judgment, granting the divorce immediately and approving the parties' stipulation with respect to property. No alimony was provided for. The issue of child custody was reserved for further briefs.
Within 20 days after the divorce, plaintiff married Prochaska, who is a divorced father of two children who are in custody of their mother. It would appear from the record that plaintiff's affair with Prochaska involved conduct which was at least indiscreet and inappropriate for a mother having the care and custody of minor children. The trial court, in an exhaustive and well-considered memorandum accompanying his findings, expressed the view that plaintiff had not been truthful "with respect to highly material and relevant evidence." He emphasized that she was immature, wilful and coarse in her speech and conduct, and exhibited a lack of the qualities expected of a "good mother." The record supports the trial court's view that the husband, on the other hand, has a stable character, has been employed by IBM at Rochester for 11 years, and is engaged to marry a young lady of excellent reputation. Prochaska has been transferred to Atlanta. Georgia, where he and plaintiff will make their new home.
In determining the issue of custody of the children, the trial court fully considered the rights of the mother to the custody of young children, in light of her character and personal qualities, as bearing upon the basic issue of whether such custody might be for the best interests of the children. The trial court fully considered the circumstances of the father, having in mind that he might be expected to establish a favorable home environment by his new marriage, together with the circumstance that the minor son had a natural attachment for his father which was returned by the father's devoted interest in his son. The trial court accordingly came to the conclusion that, subject to reasonable rights of visitation by the parties, the mother should have custody of Brenda, the 9-year-old daughter, and that the father should have custody of Michael, the 7-year-old son. The part of the order relating to the custody of the daughter is not before us. The order is attacked because it gives custody of the son to the father.
Plaintiff relies on those authorities which express the view that custody of very young children should be awarded to the mother. Johnson v. Johnson, 223 Minn. 420, 27 N.W.2d 289; Lindberg v. Lindberg, 282 Minn. 536, 163 N.W.2d 870; Hanson v. Hanson, 284 Minn. 321, 170 N. W.2d 213; Borchert v. Borchert, 279 Minn. 16, 154 N.W.2d 902; Lobash v. Lobash, 283 Minn. 255, 167 N.W.2d 43; Eisel v. Eisel, 261 Minn. 1, 110 N.W.2d 881; Meinhardt v. Meinhardt, 261 Minn. 272, 111 N.W.2d 782. We have also observed that the father and mother are the natural guardians of the minor children and, if not unsuitable, are, depending upon the circumstances, equally entitled to their custody. Spratt v. Spratt, 151 Minn. 458, 185 N.W. 509, 187 N.W. 227; Fish v. Fish, 280 Minn. 316, 159 N.W. 2d 271; 6A Dunnell, Dig. (3 ed.) § 2800c. Plaintiff contends that, because of the ages of the children, they should be kept together and placed in her custody and that this result is required by the well-recognized rule that the welfare of the children is the primary consideration and not the welfare of the parent. The rule that young children should be given to the custody of the mother is not inflexible, and there are circumstances under which the custody of young children may be awarded to the father, even though the mother is found to be a suitable custodian. The comparative fitness of the homes of the parents, their ability to support and care for the child, and *881 other facts are to be considered. See, Hanson v. Hanson, supra; 24 Am.Jur. (2d) Divorce and Separation, § 785; 6A Dunnell, Dig. (3 ed.) § 2800.
The controlling statute is Minn.St. 518.17, which gives the court discretion to make provision by order for the care, custody, and maintenance of minor children of the parties.[1] By a 1969 amendment, the legislature expressed the policy to the effect that subject to the overriding concern for the best interests of the child the sex of the parent should not be the sole basis for determining custody. This amendment does no more than express views contained in prior decisions of this court. Spratt v. Spratt, supra; Fish v. Fish, supra; 6A Dunnell, Dig. (3 ed.) § 2800c.
In his findings of fact, the trial court noted:
"The defendant father * * * is a very good and capable parent in which to place custody of both children * *."
Further, in a memorandum made part of the order, the trial court said:
"This Court finds specifically that the care and attention given these children by the defendant father at all times was good and ideal * * *."
In this difficult situation where the parties dislike each other but are equally devoted to their children, it was impossible to make a disposition with which both parties could be easily reconciled. We are satisfied that previous authorities of this court, especially Hanson v. Hanson, supra, and Fish v. Fish, supra, warrant the disposition made by the trial court, and we cannot say there was error resulting from an abuse of discretion in determining custody.
No costs or disbursements will be allowed.
Affirmed.
NOTES
[1]  Minn.St. 518.17 provides: "Upon adjudging the nullity of a marriage, or a divorce or separation, the court may make such further order as it deems just and proper concerning the care, custody, and maintenance of the minor children of the parties and may determine with which of the parents they, or any of them, shall remain, having due regard to the age and sex of such children and the children's relationship with each parent prior to the commencement of the action. In determining the parent with whom a child shall remain, the court shall consider all facts in the best interest of the children and shall not prefer one parent over the other solely on the basis of the sex of the parent. In determining the amount of child support to be paid by each parent, the court shall consider the earning capacity of each parent. Any change in child support because of alleged change in circumstances shall take into consideration the earning capacity of each parent and the parent's spouse, if any."
