
177 N.W.2d 267 (1970)
Patricia Eloise HERSHEY, Plaintiff and Appellant,
v.
Brooke Curtis HERSHEY, Defendant and Respondent.
No. 10673.
Supreme Court of South Dakota.
May 14, 1970.
*268 Hayes & Richards, Deadwood, for plaintiff and appellant.
Costello, Porter, Hill, Banks & Nelson, Rapid City, for defendant and respondent.
ROBERTS, Presiding Judge.
The plaintiff and the defendant were married December 19, 1959, at Bellevue, Nebraska. Paceon Dodd, the sole issue of the marriage, was born on June 17, 1966. Defendant was a student at a medical school in Omaha, Nebraska, at the time of the marriage. The parties in the summer of 1961 moved to a ranch near Batesland, South Dakota, and there resided until the spring of 1965 when they moved to a ranch near Sturgis, South Dakota, where they continued to reside until separation in September 1967. Plaintiff wife commenced an action for divorce on the grounds of extreme *269 cruelty. The defendant denied the allegation of cruelty and counterclaimed for divorce and child custody. Plaintiff replied and served defendant with an amended complaint.
On April 4, 1968, an agreement as to property rights and custody and support of the minor child was entered into. The parties agreed that the amended complaint and the original answer and counterclaim together with affidavits on file be withdrawn; that defendant file an amended answer and counterclaim and bring on for hearing the cause of action to be stated in the amended counterclaim; and that defendant apply for an order permitting the withdrawal of the documents described from the court files and return thereof to counsel of the parties to be destroyed. It was also provided that the plaintiff have primary custody of the child for the period between August 20 of each year to June 12 of the following year and that defendant have custody during the remaining period. It was agreed that on or before August 12, 1968, plaintiff would take up residence within a radius of one hundred miles of Sturgis and that if she did not so comply, the primary rights of custody provided in the agreement would become the primary right of the defendant so long as plaintiff shall elect to maintain her residence beyond the radius limitation agreed upon. It was also agreed that the party who shall not at any time enjoy primary custody be entitled to certain visitation rights. The defendant was required to pay $125.00 per month for support of the child so long and to the extent that custody remained in the plaintiff. The judgment of divorce was entered April 11, 1968, granting defendant a divorce by default and reciting that the custody agreement of the parties was approved and adopted by the court and incorporated into the decree by reference.
The defendant on July 3, 1968, was married to Mary Wheeler who was divorced from her first husband. Defendant resides on his ranch near Sturgis with his present wife and her three young daughters. On September 13, 1968, plaintiff was married to Ernest Kephart who is employed by a telephone company in Omaha, Nebraska.
On August 14, 1968, plaintiff filed an application for modification of the original decree by relieving plaintiff of the residential requirements alleging an inability to obtain employment within a one hundred mile radius of Sturgis. She therein contended that the conferences with attorneys in regard to the property settlement and child custody left her very nervous and distraught and in such condition that she did not actually understand the provisions thereof which in effect require her to terminate her employment with the State Hospital for Mentally Retarded in Glenwood, Iowa, and move to within one hundred miles of Sturgis, and asserts her inability after diligent effort to obtain within such area employment as a social worker. She had completed a course of training in social work and was then employed in such capacity. Defendant served and filed an affidavit in resistance to plaintiff's application contending that the purpose of the residential requirements was to provide assurance that if the misconduct of the plaintiff were to continue, defendant could then seek redress and modification of custodial rights.
On hearing of the application of the plaintiff to modify the judgment and decree, the court received over objection evidence of alleged marital misconduct and unfitness of the plaintiff prior to the divorce. The court found that the defendant was the fit and proper person, not the plaintiff, to have custody of the child. The court by what is denominated a judgment and decree dated October 21, 1968, awarded permanent custody to the defendant subject to rights in the plaintiff of weekend visitation and to have the child in her home during the month of August of each year. An application for modification of the provisions of a judgment for divorce respecting the custody of a minor child under the statute (SDCL 25-4-45) providing that the court retains jurisdiction *270 to give such direction for custody of the minor children as may seem proper is a proceeding incident to the original suit and the determination therein results in an order as distinguished from a judgment. Foster v. Foster, 66 S.D. 395, 284 N.W. 54; cf. In re Badger State Bank v. Weiss, 60 S.D. 484, 245 N.W. 41. We deem it proper, however, upon a consideration of the record to treat the determination of the court as an order.
It has long been the rule in this jurisdiction that the doctrine of res judicata applies to that part of a divorce decree giving direction for the custody and care of the children of the marriage and that the jurisdiction of the court cannot be invoked to inquire into the same or other facts existing at the time or prior to the former decree. Vert v. Vert, 3 S.D. 619, 54 N.W. 655; Wallace v. Wallace, 26 S.D. 229, 128 N.W. 143; Wellnitz v. Wellnitz, 71 S.D. 430, 25 N.W.2d 458; Application of Habeck, 75 S.D. 535, 69 N.W.2d 353; Huckfeldt v. Huckfeldt, 82 S.D. 344, 146 N.W.2d 57. True, the welfare and best interests of the child is of paramount importance, but when this has once been determined, and custody order entered, it will not be overturned unless a material and substantial change of circumstances has occurred. A final decree awarding custody of a child based upon an agreement of the parties is a judgment of the court and is conclusive as between the parties if no change of circumstances affecting the welfare of the children is shown. Application of Heintz, 78 S.D. 188, 99 N.W.2d 794; Moser v. Moser, 82 S.D. 149, 143 N.W.2d 369. We recognize that in some jurisdictions a court's determination based upon an agreement as to custody is not res judicata and the rule of changed conditions does not apply.
The child in this action, twenty-two months old at the time of the entry of the original decree, was of "tender years" within the meaning of SDCL 30-27-19. This section provides that a court in awarding custody is to be guided (1) by what appears to be for the best interests of the child, and (2) as between parents adversely claiming custody neither parent is entitled to it as a matter of right, but other things being equal, if the child is of tender years, it should be given to the mother. We held in Wiesner v. Wiesner, 80 S.D. 114, 119 N.W.2d 920, that in the absence of some compelling reason to the contrary preference is to be given the mother in awarding custody of a child of tender years. We have many times discussed the provisions of this statute. Hines v. Hines, 78 S.D. 464, 104 N.W.2d 375; Howells v. Howells, 79 S.D. 480, 113 N.W.2d 533; Stearns v. Stearns, 80 S.D. 443, 126 N.W.2d 124; Yager v. Yager, 83 S.D. 315, 159 N.W.2d 125; Dornbusch v. Dornbusch, 83 S.D. 524, 162 N.W.2d 283.
Where a mother has been guilty of marital misconduct and there is no evidence of demonstrable effect of such conduct upon the child, it does not follow that she is an unfit person to have custody and that an award of custody to her is not in the best interest and welfare of the child. Wiesner v. Wiesner, supra; Septka v. Septka, 80 S.D. 299, 122 N.W.2d 766; Dornbusch v. Dornbusch, supra. The evidence and the findings of the court fail to show a material and substantial change of circumstances subsequent to the divorce decree requiring the awarding of exclusive custody to the defendant. We also conclude that regardless of the conclusiveness of the original decree and application of the rule of change of circumstances, it does not from the evidence appear that misconduct of the plaintiff will affect the best interests and welfare of the child. Defendant in his testimony admitted that the plaintiff has tender affection for the child and has been a good mother. The foregoing considerations require reversal of the modification order from which plaintiff has appealed.
It appears that plaintiff at the time of hearing her application to modify *271 the original decree was employed in the vicinity of Omaha, Nebraska, as a social worker and receiving a substantial salary. It is without dispute that she has been unable to obtain employment in such or similar capacity within the one hundred mile radius specified in the separation agreement incorporated in the original decree; that she resides with her present husband at his domicile; and that their home, surroundings and conveniences are suitable for the proper care of the minor child. The elimination of the requirement that plaintiff resume her residence in this state would not affect the right of the defendant to alternate custody as provided in the original decree. Concededly, visitation of the child by defendant in another state would be more inconvenient than would be visitations provided in the original decree. A distinction between custody and visitation rights is recognized and modification of the latter rights can be ordered without showing material change in the circumstances of the parties when custodial rights are not prejudiced. Lamb v. Lamb, 348 Mich. 557, 83 N.W.2d 323; Felker v. Felker, Tex.Civ.App., 216 S.W.2d 669; Syas v. Syas, 150 Neb. 533, 34 N.W.2d 884; Evans v. Evans, 195 Miss. 320, 15 So.2d 698; 27B C.J.S. Divorce § 317(2), p. 541. Inconvenience of visitation is not here a factor preventing termination of residential requirement in this state. The circumstances in our opinion justify termination of such requirement and the continued primary custody of the child of tender years in the mother.
During the pendency of the appeal counsel for the parties, because of the health and physical condition of the child, stipulated that plaintiff mother have temporary custody. After hearing, this court upon the basis of the agreement entered an order authorizing such custody. The child is with his mother in Omaha, Nebraska, and has there had medical care and treatment. The circumstance of the health and physical condition of the child was not before the trial court and we have not considered whether because of health divided custody might be contrary to the child's welfare. Any order made concerning the custody of a minor child of divorced persons as we have indicated is always subject on proper showing to modification.
The order of the Circuit Court modifying the original judgment is reversed and the cause remanded with directions to modify such judgment by eliminating residential requirements and to provide such visitations of the child by the parents as the court may deem suitable and consistent with the welfare of the child.
All the Judges concur.
