
855 P.2d 90 (1993)
In re the Matter of CUSTODY OF C.J.K., a minor.
No. 92-294.
Supreme Court of Montana.
Submitted on Briefs March 4, 1993.
Decided June 8, 1993.
Robert G. Olson, Frisbee, Moore & Olson, Cut Bank, for appellant.
Susan L. Weber, Miller & Cook, Great Falls for respondent.
HUNT, Justice.
This is an appeal from the Ninth Judicial District Court, Toole County, Montana. The appellant mother appeals the District Court's award of joint custody with the respondent father in which respondent was designated primary residential custodian of the minor child, C.J.K. We reverse and remand.
The following issue is dispositive of this case:
Was the issue of primary physical custody of C.J.K. properly before the District Court?
On July 24, 1990, C.J.K. was born to appellant and respondent after a one-year relationship in which the parties resided together but were never married. Prior to the birth of C.J.K., there were four other children born to appellant from a previous marriage, and one child from a previous relationship. C.J.K. is respondent's only son.
Several months after the birth of C.J.K., the parties separated and have since lived apart. Because of this separation, it was necessary to determine custody and support issues for C.J.K. Appellant filed a *91 petition for custody and support on March 12, 1991, which requested that there be "joint care, custody and control"; that she be the custodial parent; and that respondent be granted reasonable rights of visitation. Respondent filed a response and counterpetition on June 27, 1991, which requested split custody until C.J.K. reached the age of five, at which time respondent would be granted primary physical custody. On February 21, 1992, the parties went to trial on the issues of custody and support of C.J.K. During trial, respondent moved for an order that he be granted immediate primary custody of C.J.K. Counsel for appellant immediately made a motion to stay or continue the proceedings on the basis of surprise.
Was the issue of primary physical custody of C.J.K. properly before the court?
In his response and counterpetition, respondent specifically requested that appellant be designated primary physical custodian for eight months of the year, and that he be designated primary physical custodian for only four months of the year until C.J.K. reaches age five. No mention was made of respondent being designated primary physical custodian before C.J.K. reached the age of five.
After the conclusion of appellant's case-in-chief, respondent unexpectedly requested immediate primary physical custody. This was the first time appellant was put on notice that respondent sought immediate custody and that she might lose her right to custody.
The purpose of a pleading is to provide notice before trial to the opposing party of the specific relief being sought so that both parties have an opportunity to present evidence on the issues in dispute. Gallatin Trust Bank v. Darrah (1968), 152 Mont. 256, 261, 448 P.2d 734, 737. The requirement that all issues to be tried must be raised in the pleadings is extended to child custody disputes by In re Custody of C.S.F. (1988), 232 Mont. 204, 209, 755 P.2d 578, 581.
An exception to the requirement that all issues to be tried must be raised in the pleadings, is set out in Old Fashion Baptist Church v. Department of Revenue (1983), 206 Mont. 451, 457, 671 P.2d 625, 628:
A District Court does not have jurisdiction to grant relief outside of the issues presented by the pleadings unless the parties stipulate that other questions be considered or the pleadings are amended to conform to the proof.
The parties may "stipulate" or consent to consideration of issues outside of the pleadings expressly or impliedly. Butte Teachers' Union v. Board of Trustees (1982), 201 Mont. 482, 486, 655 P.2d 146, 148. In the case at bar, respondent argues that since appellant raised the issue of primary physical custody in her petition and he specifically contested the issue, in essence, appellant expressly consented to trial on this issue. We disagree.
Respondent, in his responsive pleading, set out the parameters of the dispute which did not include a request that he be granted primary physical custody at the present time. Appellant never expressly consented to trial on any issue except that which was discussed in the responsive pleading.
Concerning the issue of implied consent, we have stated that "pleadings will not be deemed amended to conform to the evidence because of "implied consent" where the circumstances were such that the other party was not put on notice that a new issue was being raised." Darrah, 448 P.2d at 737. In the case at bar, appellant did not receive adequate notice before trial, and therefore, could not impliedly consent to consideration of the new issue of whether or not respondent be granted immediate primary physical custody. Appellant's adamant objection to the consideration of this issue, and her claim that she was "caught off-guard" by this "eleventh-hour change in attack" is in no way indicative of implied consent.
Because of lack of notice, possible prejudice to appellant must be considered. Respondent's unexpected request denied appellant adequate opportunity to prepare her case thereby denying her due process of law.
*92 We conclude that the determination of primary physical custody was not properly before the District Court.
Reversed and remanded for further proceedings in accordance with this opinion.
TURNAGE, C.J., and GRAY, TRIEWEILER, McDONOUGH and WEBER concur.
HARRISON Justice dissenting.
I dissent. I would hold that the determination of primary physical custody of the minor child was properly before the District Court, and I would affirm the District Court's award of joint custody and the court's designation of the respondent father as the primary residential custodian of the minor child.
The record is clear. The minor, C.J.K., was born on July 24, 1990, to the mother and father after a one-year relationship in which the mother and father resided together but never married. C.J.K. is the youngest of six children born to the mother; four other children were born to the mother from a previous marriage, and she had one other child from a previous relationship. C.J.K. is the father's only child.
Nearly eight months after the birth of C.J.K. and after the parties' relationship failed, the mother filed with the District Court a "Petition for Custody and Support" wherein she asked the court to award joint custody of C.J.K. to the parties with herself as the primary custodial parent, and to require the father to pay child support according to the Uniform Guidelines. In his response and counter-petition, the father prayed that joint custody be awarded the parties with the mother as primary custodian until C.J.K. reached the age of five, when the father would be granted primary physical custody. The father's counter-petition also provided for liberal visitation for the noncustodial parent. It also provided that the father would pay child support during each month that C.J.K. was in the mother's care; that the income tax exemption could be claimed by the primary physical custodian; that the father would provide C.J.K's medical insurance; that any uncovered medical expenses would be shared equally by the parties; and that each party would be responsible for his or her individual attorney's fees and costs incurred in this matter.
At the hearing in February, 1992, the father requested for the first time that he, not the mother, be designated as the primary custodial parent. The mother filed a legal memorandum setting forth her objections to this unanticipated oral request. The District Court properly took the position that in Montana it is clear that the court's duty is to look to the "best interest of the child" regardless of the custodial arrangements sought by the parties.
Custody of C.J.K. and the parties' concerns for his best interest were thoroughly discussed at the February, 1992, hearing. Again, the record is clear. It indicates, at length, a severe problem in the mother's home as to the care of her six children, including her failure to supervise the children; and that C.J.K. was left in the custody of her oldest daughter, who was fifteen at the time of the District Court hearing. Often during the week the mother did not return home until 2:00 or 3:00 a.m., leaving the fifteen-year-old to care for the younger children. The court's findings of fact indicate that the Family Services Department had investigated five complaints relating to the filthy and unhealthy condition of the mother's home. The record also indicates that the mother refused to cooperate with the father in several areas concerning C.J.K.
I find that the first issue, whether primary physical custody of C.J.K. was properly before the District Court, is the key to the resolution of this matter. The mother alleges that the issue of primary physical custody was not before the court, as the father had requested split custody in his response and counter-petition. I disagree. This issue was placed before the court by the mother herself in her "Petition for Custody and Support," in which she prayed that C.J.K. be placed in the joint care, custody and control of the mother and father, with the mother as "custodial parent." *93 This request in itself raises the question of primary physical custody.
In response to the mother's petition, the father denied that making the mother the custodial parent was in C.J.K.'s best interest and requested a split custody arrangement until C.J.K. reached the age of five, at which time the father requested that he be granted primary physical custody. Primary physical custody of C.J.K. was the central issue of the entire testimony before the District Court. Both parties presented evidence on the issue and the District Court properly applied the best interest test in designating the father the primary residential custodian of C.J.K.
This Court has held that under § 40-4-212, MCA, the best interest of the child factor is controlling regardless of any requests by either party, and that the court's failure to consider its elements could result in reversible error, even if the parties themselves have entered into an agreement regarding the issue of custody. In re Marriage of Mager (1990), 241 Mont. 78, 785 P.2d 198; In re Marriage of Converse (1992), 252 Mont. 67, 826 P.2d 937.
Here, the record indicates that the District Court considered all of the statutory criteria for determining the child's best interest, and that its findings and conclusions are supported by substantial credible evidence.
I would hold that the determination of primary physical custody was properly before the District Court and that the court did not err in making its determination under § 40-4-212, MCA. I would affirm.
