
325 Mass. 594 (1950)
91 N.E.2d 832
WILLIAM HACKER
vs.
ALFRED E. BECK. (and two companion cases[1]).
Supreme Judicial Court of Massachusetts, Essex.
February 28, 1950.
April 3, 1950.
Present: QUA, C.J., LUMMUS, RONAN, SPALDING, & COUNIHAN, JJ.
S.C. Struffolino & M. Nicholson, for the plaintiff.
J.A. Donovan, G.K. Black & S. DeBard, for the defendants.
RONAN, J.
These are three separate actions of tort for deceit to recover damages from each of the defendants. The defendants by a plea, demurrer and answer set up that the final decree dismissing the bill entered in a previous suit against a corporation and all of these defendants and the judgments entered in their favor in the three earlier actions at law which were brought respectively against each of these defendants constitute a bar to the maintenance of the instant actions. The present actions were heard in the Superior Court by order of the judge on the single issue of res judicata. Certified copies of the record in the suit in equity and in the three earlier actions at law comprised all the evidence that was introduced at the hearing. The plaintiff admitted that the parties in the present actions were the same as those in the previous litigation. The judge found for the defendant in each case on the ground that the defence of res judicata had been sustained. He then reported to this court the correctness of his decision in sustaining this defence and his findings for the defendants.
The "plea of res judicata," so called, in each case set up *596 matters in bar to the maintenance of the actions and alleged a defence which could properly have been included in the answers of the defendants, as in fact they were in the answers filed in these cases. We treat these pleas as answers according to their substance and nature. Gallo v. Foley, 299 Mass. 1, 4. Charles I. Hosmer, Inc. v. Commonwealth, 302 Mass. 495, 498. Essex Trust Co. v. Averill, 321 Mass. 68, 70.
The final decree dismissing the bill in equity with costs to the defendants was entered on May 13, 1946, upon a motion of the plaintiff for an order dismissing the bill. The decree did not adjudicate any of the issues presented by the bill and would not bar a second suit or action raising the same issues. Pontiff v. Alexander, 320 Mass. 514, 516. Metropolitan Transit Authority v. Railway Express Agency, Inc. 323 Mass. 707, 709.
The declarations in the three first actions at law were amended, and the demurrers to these declarations were after a hearing sustained on January 12, 1948, and an order was entered in each, "After hearing the within demurrer is sustained." Judgment in each action for the defendant together with costs was entered in February, 1948. These demurrers were grounded on numerous matters of form and of substance. Each demurrer set forth, among other things, that the allegations in the declaration were insufficient in law to maintain the action; that the cause of action was not stated concisely and with substantial certainty; that the allegations were so lacking in certainty that the defendant was unable to prepare his defence; that the counts alleged two different causes of action and it was not clear upon which cause the plaintiff relied; that certain allegations were inconsistent with other allegations; and that many allegations which were specifically named were immaterial and irrelevant. The statute of frauds and the statute of limitations were also set up in these demurrers.
Even if we assume in favor of the defendants that the earlier actions were for the same cause of action as the present actions, Mackintosh v. Chambers, 285 Mass. 594; *597 Siegel v. Knott, 318 Mass. 257, it would not necessarily follow that the judgments in the first actions would bar the maintenance of the second actions. We need not, however, decide whether the cause of action in the earlier litigation is the same as in the present controversy, in view of the conclusion we reach in this opinion.
The defence of res judicata ordinarily must rest upon the fact that a judgment upon the merits had been entered in the former litigation. It has been pointed out that a decree, "although founded upon a demurrer, may under proper circumstances be a bar to another suit, as well as one founded upon a hearing of evidence." Old Dominion Copper Mining & Smelting Co. v. Bigelow, 203 Mass. 159, 205. Capaccio v. Merrill, 222 Mass. 308, 310. The general rule in this Commonwealth is that a judgment following the sustaining of a demurrer is not a bar to a second action for the same cause of action. It has been stated that "The reason for the rule is that such a judgment commonly is based not on the merits but upon the insufficiency of the statement of the cause of action." Whitney v. Whitney, 299 Mass. 547, 550-551. Wilbur v. Gilmore, 21 Pick. 250, 253. Foster v. The Richard Busteed, 100 Mass. 409, 412. Capaccio v. Merrill, 222 Mass. 308, 310. Keljikian v. Star Brewing Co. 303 Mass. 53, 60.
There is, however, a well established exception to this general rule, and a judgment in the earlier action following the sustaining of a demurrer is a bar to a second action for the same cause of action where the plaintiff had been granted leave to amend his earlier declaration and had neglected or refused to do so. In such instances, the judgment entered in the first action is deemed to have been entered on the merits. Keown v. Keown, 231 Mass. 404, 408. Abbott v. Bean, 295 Mass. 268, 275. Whitney v. Whitney, 299 Mass. 547, 550-551. Elfman v. Glaser, 313 Mass. 370, 373-376.
The defendants are not aided by Rule 23 of the Superior Court (1932) which provides that "If a demurrer is sustained, and leave to amend is not denied, a case shall be deemed ripe for final judgment or decree only after ten days *598 from the sustaining of the demurrer, or such other time as the court may allow for amendment, and then only after the disposition of any motion to amend the pleading demurred to, filed within such time." The exception to the general rule making a judgment after demurrer a bar to the second action requires the concurrence of two particular factors  neither of which is covered by the said court rule  first, a leave to amend expressly granted and, second, a refusal to accept the privilege. That both are essential to constitute the exception to the general rule was carefully pointed out in Elfman v. Glaser, 313 Mass. 370, 374-375.
Res judicata is an affirmative defence. The judgments entered in the previous actions do not come within the exception to the general rule because no leave to amend was granted when the demurrers in those actions were sustained. Consequently, the only ground remaining upon which this defence could by any possibility be maintained is that the judgments in these previous actions followed demurrers which were based on the merits. This defence, however, cannot be successfully sustained where it appears, as here, that the previous judgments might have been entered on a number of grounds, some of which were sufficient to support this defence while others were not, unless the defendants proved that the orders sustaining the demurrers were rendered upon some particular ground going to the merits and not upon some other grounds. In the cases at bar, the demurrers were based on matters of form and of substance and were sustained generally. There is nothing to show upon what grounds they were sustained. The defendants have failed to prove that they were sustained upon the merits rather than by reason of formal or technical defects in the declarations. McAlevey v. Litch, 234 Mass. 440. Tighe v. Skillings, 297 Mass. 504. Cochrane v. Cochrane, 303 Mass. 467. Hopkins v. Holcombe, 308 Mass. 54.
It follows that there was error in sustaining the defence of res judicata, and in the finding for the defendant in each action. These findings are vacated. The actions are to *599 stand in the Superior Court for further proceedings on any issues that might be presented there except the issue of res judicata.
So ordered.
NOTES
[1]  The companion cases are by the same plaintiff against George L. Black and Frederick L. Teichert, respectively.
