
74 Cal.App.2d 711 (1946)
DAVID SCHWARTZ, Appellant,
v.
SOFIE SCHWARTZ, Respondent.
Civ. No. 15238. 
California Court of Appeals. Second Dist., Div. One.  
May 28, 1946.
 John R. Barta for Appellant.
 Paul R. Matthews for Respondent.
 DORAN, J.
 This is an appeal from a judgment on the pleadings in an action for divorce.
 The complaint by the husband is in the usual form and based on extreme cruelty. No specific dates are alleged. The answer is a general denial. A separate defense is also alleged setting forth the fact that several years before, the wife had filed an action for separate maintenance in which the husband had answered and, in a cross-complaint, had sought a divorce on the grounds of extreme cruelty; that the wife had prevailed in said action and that "said judgment among other things ordered and adjudged and decreed that said David *712 Schwartz take nothing by his cross-complaint for divorce." No affirmative relief, admissible in such circumstances, is sought by the answer in the within action. The plaintiff filed what is entitled, "Answer to Cross-Complaint" wherein it is alleged that the course of conduct on the part of defendant wife, which constituted extreme cruelty, occurred since the entry of the judgment in the former action. Technically, the socalled "Answer to Cross-Complaint," is surplusage and out of place in the pleadings; there is no cross-complaint.
 Shortly after the trial commenced and while the plaintiff was on the stand the court commented as follows:
 "That brings a question up that I wondered about as I read the pleadings. Now, you have a separation decree; you have not filed any action to change the award that is fixed by that decree. Here you are defending an action for divorce, and I have found nothing further than affirmative defenses and denials in the Answer that has been filed."
 And later continued,
 "Now during the recess the Court called counsel's attention to the fact that it appears from the Answer of the defendant, and the Answer to that, which is headed 'Answer to "Cross-Complaint, "' by plaintiff, and by the statement of counsel here, that this defendant was granted separate maintenance by Judge Kincaid; and it must have been because the plaintiff--this plaintiff--had been guilty of acts which constituted ground for divorce; and the plaintiff in that action did not seek the divorce but only separate maintenance. It therefore having been pleaded, and being an established fact, that it establishes recrimination in so far as this action is concerned; so that even if the plaintiff in this action was successful and established that the defendant had been guilty of extreme cruelty to him since October of 1943, that the Court would be forced to deny a decree of divorce to him, since section 111 of the Civil Code provides that "Divorces must be denied upon showing'--among other things--'recrimination'; and sec. 122 provides that 'Recrimination is a showing by the defendant of any cause of divorce against the plaintiff, in bar of the plaintiff's cause of divorce.' '' During the discussion, defendant's counsel moved for judgment on the pleadings, which was granted with the following comment by the court and plaintiff's counsel:
 "The Court: I will grant your motion, because I am convinced that under the pleadings, recrimination is admitted."
 "Mr. Barta: Well we couldn't deny that." *713
 [1] Although it appears likely, from an examination of the record, that defendant would have prevailed at the trial in any event (see Comfort v. Comfort, 17 Cal.2d 736 [112 P.2d 259]), nevertheless, it was error for the court to grant the defendant's motion for a judgment on the pleadings. Upon such a motion, "the court cannot consider any matter outside of the complaint, or any defense thereto in the answer, but the motion is to be determined upon the same principles as would be a demurrer to the complaint upon the same ground. All the facts alleged in the complaint are admitted for the purposes of the motion, and the court is to determine whether these facts constitute a cause of action." (Hibernia S. & L. Soc. v. Thornton, 117 Cal. 481, 482 [49 P. 573].) "But where judgment has been entered for defendants on the pleadings the sole question is whether the complaint states a cause of action." (Union F. M., Ltd. v. Southern Cal. F. M., Inc., 10 Cal.2d 671, 673 [76 P.2d 503].)
 There can be no question that all of the facts stated in the complaint in the within action state a cause of action.
 The judgment therefore must be reversed and it is so ordered.
 York, P. J., and White, J., concurred.
