delivered the opinion of the court:
Plaintiff, E. R Johnson, October 21, 1940, filed his complaint in the circuit court of Winnebago county, praying for a divorce from defendant, Virginia Johnson, on the ground of desertion. Summons was served upon defendant, together with a certified copy of the complaint, in Hampton, Virginia, where defendant resided. She filed her special appearance and motion to dismiss on the ground of lack of jurisdiction. Upon denial of her motion and pursuant to order of court she filed her answer. She denied plaintiff was a resident of Illinois and that the court had jurisdiction of the cause, admitted the marriage and *364that there were two children of the marriage, and denied desertion. Plaintiff’s motion to strike the answer was overruled. A decree was entered April 4, 1941. The court found it had jurisdiction of the parties and subject matter; that plaintiff was an actual resident of the county of Winnebago and State of Illinois; that the parties were married June 21, 1918; that defendant wilfully deserted plaintiff in the month of September, 1931, and that such wilful desertion continued until the time of the hearing. Conformably to leave granted, defendant appeals from the judgment of the Appellate Court affirming the decree.
Plaintiff, a commander in the United States Navy, testified he was born in Rockford, graduated from high school there in 1913 and, in 1914, received his appointment to the Naval Academy, and that he has been in the naval service ever since. He testified his duties required him to be stationed wherever ordered by the naval authorities. He explained that during peace-time routine officers can generally expect alternately a three-year tour of sea duty, followed by a tour of shore duty lasting two years. His testimony discloses that the only times he and his wife lived together during their married life were the following: from September, 1919, until February 1, 1920, in an apartment in Philadelphia while he was stationed at the navy yard; from September, 1923, until June, 1924, in Annapolis, while he attended post-graduate school; in 1925, when they spent his month’s leave at his parents’ home in Rockford, and from May, 1929, until May, 193Ó, in Norfolk during his assignment to the navy yard. He also testified that from 1925 until 1928, while he was at sea on the U. S. S. Richmond, it was agreed she was to remain at Hampton. From February, 1920, until June, 1920, and from September, 1921, until February, 1922, while he was stationed at Constantinople and Vladivostok, respectively, naval officers had been advised to leave their families home, *365because of conditions there and possible danger to life and health. Two instances were related by him wherein he claimed his wife failed to join him, one in June, 1921, when he wrote her from Constantinople to meet him in Manila. However, he was transferred to Vladivostok, from which point he wrote rescinding his previous request because his ship was scheduled to sail to the United States via Manila. Upon arrival at Manila his itinerary was altered, and he was ordered to the Orient. Thereupon, he again revised his instructions, and requested her to meet him at Manila. He also advised her that the U. S. S. Henderson, a navy transport, would leave Hampton Roads, some time in May, 1922. She wrote stating she could not leave. She also failed to meet him in San Francisco August 1, 1923, pursuant to his previous request mailed from ■China, in May, 1923.
Plaintiff further testified that upon detachment from the U. S. S. Richmond, in October, 1928, he was ordered to shore duty in the Norfolk navy yard, located about thirty-five or forty miles from Hampton. Defendant remained in Hampton, where he visited her weekly for six months, each time remonstrating with her for not moving to Norfolk. Finally, in May, 1929, upon her refusal to accompany him, he declared, “I won’t be coming over here any more,” and returned to Norfolk. The following Saturday he left their automobile and keys at her home and returned to Norfolk without seeing her. She telephoned the next day stating she had changed her mind. She went to Norfolk and they selected an apartment, purchased furniture, and lived together, as previously stated, from May, 1929, until May, 1930.
In May, 1930, pursuant to previous discussions with his wife, he sought and received an assignment to the U. S. S. Lexington, with the Pacific Fleet, based at Long Beach, California. Inasmuch as they were then expecting *366the arrival of their second child, his wife deemed it inadvisable to accompany him, but promised to join him later in California. Finally, he testified, he acceded to her request to remain in Hampton until the child was one year old. They left their apartment in Norfolk about the middle of May, 1930. His wife returned to Hampton. The household goods were, at his direction, conveyed there by a navy moving van. From May to June he often visited his wife, and wrote her upon his arrival in California and at frequent intervals thereafter. He remained there three years. The first child, Joseph, was born in July, 1924; the second child, Patricia, in July, 1930, shortly after his departure for California. He further testified that when the second child was a year old he communicated with his wife about coming to California; that she answered stating her willingness to join him, whereupon he wrote asking the exact date, so that he could request transportation for her and their household effects; that in September, 1931, three months later, he received a reply stating that she did not want to go to California; that he again wrote her, reminding her of her previous promise, stating he could compel her to join him but would not do so, and asking her to advise him when she changed her mind, declaring that if she came it must be only under the condition she was ready and willing to leave her parents permanently and to establish their home wherever he was stationed; .that in about a month he received her reply, stating that a doctor, had told her the second year of a child’s life was delicate, dangerous and important, and that she deemed it inadvisable to leave her home and her parents, because Of their age, also because of her fear of traveling alone, of the child becoming ill, and of living alone in California when he was at sea.
Plaintiff further testified that the first year of their marriage he made an allotment to her of $150 per month. The *367testimony also shows this allotment was increased in 1930 to $200 a month. He stated he did not further correspond with his wife except that he notified her in-June, 1933, of his shore-duty appointment in San Francisco and gave her his official address. In January, 1934, she wrote evincing a desire to visit him for several weeks with her two sisters and the children. His reply thereto stated he would be delighted to have her come to San Francisco to live with him permanently in their own home but under no other conditions. He said he received no answer.
On cross-examination, plaintiff testified that on his transfer to duty in Washington, D. C., in 1938, he gave his wife his official address; that at this time his boy was fourteen years old; that he had not seen him for eight years and had never seen his daughter, and that from the time he returned to Washington' he never went to Hampton, about 200 miles away, to see his son, daughter or wife. He also testified as to an occurrence in Washington in July of 1939. Upon answering a telephone call he heard a child’s voice say: “Daddy.” Plaintiff testified, “I hung up the receiver. I suspected the call was from my daughter. I did not learn that it was from anybody. I had never seen that daughter * * * at the time of that call.” Shortly thereafter, the telephone operator called again, informing him of a long distance call from Hampton, and he told the operator, “I don’t want to receive any calls from Hampton.” He testified that later the same month his wife and two children came to the University Club in Washington. He denied that on this occasion defendant had stated to him, “I am here to ask you again to make a home for us.” Plaintiff further testified that after mailing the letter, identified as defendant’s exhibit 6, dated October 10, 1939, he had retained two lawyers, Morrison and Howder, in Washington to represent him. He admitted he was present in Washington at a meeting attended by his wife, *368Morrison, ’Howder and one Kearney, and that “at that conference Mrs. Johnson was asked by my counsel to start action for divorce against me, that was after this letter * * * was written, that was after all the claimed acts of desertion which have been testified to here today and after the claimed refusals to come and live with me.” He also testified that in his letter of October 10 to defendant,, in which he asked her to procure a divorce, he did not claim that she had deserted him or had refused to live with him; that he did not so claim, nor did anyone so claim for him at the meeting in Washington when he was represented by the two lawyers; that the first time he had ever officially claimed, since June, 1918, that his wife had deserted or refused to live with him was when this action was commenced. Plaintiff further testified that during the period from 1930 until the time of the hearing he had sent his wife a present every Christmas, usually a check representing his pay for the month of December; that during this ten-year period he had written her about a dozen letters, more or less, and that he had exchanged Christmas and birthday gifts with his wife and children. He further testified that he never offered to send a navy truck for the purpose of transporting their household goods to any other place; that while assigned to the Lexington he was on actual shipboard away from Long Beach, California, probably twenty-five per cent of the time, the balance of the time being spent in and out of Long Beach daily; that his only room or home was on the ship, and that when transferred to San Francisco he lived in an apartment house for a year and ten and a half months, after which he went on sea duty aboard the U. S. S. Dent.
At the close of plaintiff’s evidence, defendant made a motion to find for her and to dismiss the complaint for the reason that the proof did not establish wilful desertion. This motion was argued before the court, and was denied. *369After denial, defendant was called as a witness in her own behalf, whereupon plaintiff’s attorney, stated, “Now, your Honor, the rule is in this State that after they make a motion in a chancery suit to find for the defendant they cannot put on evidence. I do not know whether that applies to a divorce suit or not, but it does to other chancery suits.” The court indicated agreement, and refused to allow defendant to testify. Defendant’s attorney then stated, “So there will not be any embarrassment to counsel and court, I will withdraw the motion we have heretofore made.” He also called to the attention of the court that the motion was made orally. The court denied his motion, stating, “After you make the motion and he makes the cross-motion, you rest your case." You have rested your case; you are all through.” Defendant was thereupon tendered as a witness in her own behalf, her counsel stating she had filed an answer. The court again refused to allow her to testify. The court further refused to allow introduction in evidence of defendant’s exhibit No. 6 previously identified by her when she was called as a witness under section 60 of the Civil Practice Act.
Plaintiff contends that the motion made by defendant at the close of his evidence to dismiss his complaint because of the claimed insufficiency of the evidence to prove desertion constituted a submission of the cause to the chancellor, and that the defendant was thereby properly precluded from introducing evidence in her own behalf. It is conceded that this is the rule which obtains in general equity cases. (Fewkes v. Borah, 376 Ill. 596; Magnolia Petroleum Co. v. West, 374 id. 516; Abel v. Flesher, 296 id. 604; Thorworth v. Scheets, 269 id. 573; Koebel v. Doyle, 256 id. 610.) The reason for the rule, as stated in Koebel v. Doyle, supra, is: “To permit such a motion would result in hearing a case by piece-meal, the sustaining of a motion resulting in an appeal, and on a reversal another *370hearing on more evidence, followed, perhaps, by another appeal.” Defendant maintains, however, that, having filed her answer denying desertion, and not being in default, the court erred in not allowing her to present her defense, and, further, because the State, representing society, is a party to all divorce cases, the rule which governs in other chancery matters is inapplicable. The controlling question for decision on this appeal, therefore, is whether the court was in error in refusing to allow defendant to withdraw her motion to dismiss and in not allowing her to introduce evidence in her own behalf.
At this juncture it is pertinent to observe that courts of equity have no inherent powers in cases of divorce. The jurisdiction of courts of 'equity to hear and determine divorce cases, and all matters relating thereto, is conferred only by statute. While such courts may exercise their powers within the limits of the jurisdiction conferred by the statute, the jurisdiction depends upon the grant of the statute and not upon general equity powers. (Smith v. Smith, 334 Ill. 370; Smith v. Johnson, 321 id. 134.) Marriage is a civil contract, to which there are three parties: the husband, the wife, and the State; and while a suit for divorce upon its face is a mere controversy between the parties to the record, yet the public occupies the position of a third party; and it is the duty of the State, in the conservation of the public morals, to guard the relation. (Leland v. Leland, 319 Ill. 426; Way v. Way, 64 id. 406.) Moreover, there are two minor children in the case at bar who have a decided interest in the result of this litigation. In the Leland case, supra, the applicable rules pertaining to divorce proceedings are aptly stated: “Some of the States of this country have passed statutes giving to representatives of the State the power to intervene, or appoint officers to represent the State on the hearing of divorce actions, among which are Georgia, Indiana, Michigan, Oregon and *371Tennessee. In the absence of such statutory enactment it is a doctrine of general acceptance that the court represents the interest of the State in divorce suits. [Citations.] In 2 Bishop on Marriage, Divorce and Separation, (663, 664,) it is said: ‘The public, which we have seen to be a party in all divorce suits, occupies a unique position, sometimes embarrassing to the court. It does not ordinarily appear by counsel, and when without counsel does not plead. As against this párty, when only thus represented by what is called the conscience of the court, the plaintiff is entitled to the decree on his case being duly and fully proved. But this party, unlike the others, never loses a right by laches; and so, whenever a defense comes out in the evidence, whether alleged or not, it is fatal to the proceeding. A maxim in these suits, therefore, is, that a cause is never concluded as against the judge; and the court may, and to satisfy its conscience sometimes does, of its own motion, go into the investigation of facts not contested by pleadings. * * * The limit to the right of the public to be protected while thus, disregarding the just and common practice of the court cannot be precisely defined by rule. The judge, keeping in view the precedents, with his “conscience” always awake, should see that while the record parties are not deprived of the justice of the law, the public good, which suffers from every dishonest divorce and from every one not as well within the spirit of the statute as its terms, is not sacrificed. A rule more exact than this does not appear to be in the nature of the case possible.’ ” To like effect is Winning v. Winning, 366 Ill. 57, a divorce proceeding where a default was set aside, decree vacated, and additional notice ordered to be given defendant of the time and place of hearing before granting a default decree. In the instant case, plaintiff claims to have been deserted by defendant in September, 1931, more than nine years prior to the filing of his complaint. Defendant filed *372her answer, denying the jurisdiction of the court and also that she had deserted plaintiff. Defendant was called as an adverse witness under section 60 of the Civil Practice Act and identified eight exhibits representing letters and a telegram received from plaintiff. In one of the letters (defendant’s exhibit 6) plaintiff admits he asked her to procure a divorce. Plaintiff also admitted that in a conference in Washington, in 1939, in his presence, his counsel requested defendant to file an action for divorce against him. In 1930, plaintiff increased his allotment to her and she received $200 monthly thereafter. During all the time from 1930 until the date of the hearing the parties hereto exchanged gifts at Christmas and on. birthdays, and, by his own admission, plaintiff never at any time prior to filing his complaint officially claimed defendant had deserted him. Under these circumstances, we believe simple justice required a full and complete hearing on both sides of the controversy, and, under the discretionary power existing in the court, acting in a divorce proceeding and as a representative of the State, the court should have allowed defendant to withdraw her oral motion to dismiss plaintiff’s complaint and should have permitted her to introduce such evidence as was pertinent to the issues formed by the pleadings. As stated in 30 Corpus Juris Secundum, Equity, section 492, p. 888, “A court of equity has full power to set aside a submission of the cause for the purpose of permitting the taking of additional testimony. The matter rests in the discretion of the court. After the cause has been fully argued and submitted to' the court for its decision, it is improper for the court to receive additional evidence from either party without the knowledge of the other, unless the submission is set aside, but if, after submission of the case, matters are brought to the court’s attention which raise doubts as to fundamental claims in the case, the court may order the taking of further testimony with equal opportunity to both sides to enlighten the court.”
*373Indicative of the legislative trend is the amendment (approved July 21, 1941, and in force January 1, 1942,) to section 64 of the Civil Practice Act (Ill. Rev. Stat. 1941, chap, no, par. 188.) This amendment abolishes the former rule in equity that a defendant by moving for a finding in his favor at the close of plaintiff’s evidence thereupon submits the entire case to the chancellor for decision on the evidence adduced and waives his right to offer evidence in support of the defense in the event the motion is denied. While it is true that at the time this cause was heard the foregoing amendment to the Civil Practice Act was not in effect, nevertheless, it bears out defendant’s contention that a trial judge, in hearing a cause such as this, should not be restricted by technical conventions. Under the rule, as now amended, if the decision is adverse to a defendant he may elect to proceed to adduce evidence in support of his defense, and the motion to dismiss or for a finding is deemed to have been waived and withdrawn, making the practice in equity cases substantially the same as has heretofore obtained in actions at law.
For the reasons assigned, the chancellor, acting with a broad discretion, should have permitted defendant to present her evidence in this cause, and the failure so to do requires a new trial. It will not be necessary to • consider other grounds for reversal argued by defendant..
The judgment of the Appellate Court and the decree of the circuit court of Winnebago county are each reversed and the cause is remanded to the circuit court for a new trial in conformity with the views expressed in this opinion.
Reversed and remanded.