The question is whether plaintiff’s present action is barred as a matter of res judicata by reason of prior judgment in favor of defendants. Defendants moved to dismiss the complaint pursuant to rule 107 (subd. 4) of the Rules of Civil Practice. Special Term denied the motion on the ground that the prior judgment dismissing the complaint resulted from plaintiff having pursued a remedy which was not available; and, therefore, there was preserved to him the right to bring another action for the appropriate remedy.
*660The order denying the motion to dismiss the complaint should he reversed and the complaint dismissed. The prior judgment in favor of defendants was on the merits and is a bar to this action, the issues in both actions being the same; and, alternatively, the essential facts having been previously litigated and determined in favor of defendants, there is collateral estoppel.
The prior action was brought in the Supreme Court for Rock-land County. On a motion for summary judgment under rule 113 of the Rules of Civil Practice, based on the Statute of Frauds, Special Term dismissed the complaint. On appeal to the Appellate Division for the Second Department, the judgment was unanimously affirmed (Eidelberg v. Kestenbaum, 3 A D 2d 663; motion to amend decision denied 3 A D 2d 710). Thereafter leave to appeal to the Court of Appeals was denied, both by the Appellate Division and by the Court of Appeals. (3 A D 2d 764, 3 N Y 2d 705.)
All of the parties in the present action were in the prior action. In both actions one Albert Eidelberg was and is the plaintiff. In both actions the defendants were and are two men, Israel Kestenbaum and Herman Zellermayer, and their respective wives. In addition, in the prior action a corporation allegedly dominated and controlled by the male defendants was also made a party, because, it was alleged, a transfer of the property in suit to the corporation was contemplated.
In both actions the facts set forth in the complaints and in the affidavits arose out of the following: Plaintiff’s father, one Samuel Eidelberg, held an option to a piece of property in Rock-land County, referred to by the parties as Parcel No. 1. He negotiated with the .two male defendants, as a result of which it was agreed that they would pick up the option, purchase the property, and transfer to Samuel Eidelberg’s son, plaintiff in this and the prior action, a one-third interest in the issued stock of a corporation which would take title to the property upon the payment of various sums. The Eidelbergs were to pay for their one-third interest exactly one third of the purchase price of Parcel No. 1. The transaction was evidenced, at least in part, by a brief letter agreement, subscribed by the attorney for the defendants and addressed to the son. In this connection a partial payment of $3,000 was made by the Eidel-bergs. Before the later payments provided in the agreement came due, the defendants arranged for the purchase of an additional and adjoining parcel, which the parties call Parcel No. 2. The Eidelbergs claimed that their arrangements contemplated inclusion of this additional parcel and that the son was to receive a one-third interest in Parcel No. 2, without any pay*661ments in addition to those provided in connection with the acquisition of Parcel No. 1. This was and is disputed by the defendants. Either because of the dispute or for other reasons, the further payments required in connection with the letter agreement Avere not made by the Eidelbergs. These are the identical inceptive facts involved in both actions.
In the prior action plaintiff alleged the facts above described, phrasing them, of course, in his own version. In one allegation the letter agreement is referred to as an agreement of sale. The complaint was framed in equity, sought specific performance of the agreement and the transfer to him of a one-third interest in both Parcels No. 1 and No. 2. In addition, there was a prayer for the setting aside of any fraudulent conveyances that might have been made in respect to the parcels; and, apparently in the alternative, a claim for damages.
In the present complaint, also in equity, after setting forth the same facts there is also alleged that the parties agreed to and did become joint venturers. Indeed, the characterization of joint venture appears repeatedly in the complaint. The relief sought is a declaration that the male defendants and plaintiff were joint venturers; a trust be imposed; an accounting directed; and the male defendants and their alter egos, their Avives, convey to plaintiff an undivided one-third interest in both parcels. Alternatively, substantial damages are also sought in the event that specific performance should not be available.
In summary then, with respect to the pleadings in both actions, the identical inceptive facts are relied upon by plaintiff. The difference between the complaints is the suggestion of a sale agreement in the prior complaint and the unequivocal assertion of joint venture in the present complaint. Insofar as the relief is concerned, the complaints are virtually identical. The supporting legal theory in the prior complaint is subsumable under either specific performance of an agreement of sale or of joint venture. On the other hand, in the present complaint the theory is unequivocally that of joint venture.
In the prior action when defendants moved for summary judgment they treated the complaint as one basically in equity to obtain specific performance of a contract for the sale of real property. The motion rested solely upon the defense of Statute of Frauds, defendants urging that the writing was insufficient because it did not describe the property, was indefinite as to terms, and was not signed by any of the parties to be charged. In his answering affidavits plaintiff’s father set forth the facts according to his version, stressing that he had dealt Avith defendants in trust and confidence, but Avithout demarldng any *662legal theory upon which relief was sought. Plaintiff also submitted an affidavit by the real estate broker who had obtained the option on Parcel No. 1. The broker stated that it was his understanding that the male defendants and the Eidelbergs, or one of them, were partners, and that he, the broker, dealt with them in reliance upon that relationship.
Special Term, in a brief memorandum, granted the motion to dismiss the complaint. It did not denote the theory upon which the motion was made or granted. It was pointed out, however, that plaintiff was entitled to an equitable lien for the amount of his down payment, which sum defendants had tendered to plaintiff.
On appeal in the Appellate Division, in a very carefully prepared brief, plaintiff was at pains to urge that he was not suing upon a sale contract but upon a joint venture. He pointed out, correctly, that the Statute of Frauds did not apply to joint ventures. He stressed, citing appropriate authorities, that if in anywise his complaint was insufficient, this was immaterial because summary judgment searches the facts and is not limited by the pleadings: if he showed a cause of action the motion should be denied; and, if the complaint was insufficient he should be granted leave to replead.
Defendants met this presentation on alternative grounds, namely, that if this was a contract of sale then the Statute of Frauds defeated the claim; and, if it was claimed that it was a joint venture, then the facts were insufficient. They cited authorities to the effect that a mere agreement to take jointly an interest in property is not sufficient to sustain a joint venture. After the Appellate Division affirmed the judgment, without opinion, plaintiff, in seeking leave to appeal, again pressed the proposition that he was suing on a joint venture, not on a contract of sale, and that the Statute of Frauds was not available. Moreover, he again pointed out that summary judgment searches the facts rather than the pleadings; that if he has a cause of action his complaint should not be dismissed, even if the pleading be insufficient, but that, at worst, he should be directed to replead.
On this history it is clear that the prior judgment is res judicata as to the present cause of action. A motion granting summary judgment is on the merits. (Riley v. Southern Transp. Co., 278 App. Div. 605; 5 Carmody-Wait on New York Practice, Summary Judgment, § 44.) A judgment on the merits precludes the maintenance of a second action based upon the same transaction if the evidence and the issues in both are the same (Marsh v. Masterton, 101 N. Y. 401, 407; Hull v. Hull, 225 N. Y. 342, 353-354; Cromwell v. County of Sac, 94 U. S. 351, 352-353; *663Eestatement, Judgments, § 61), The former judgment is final not only as to every essential matter which was received to sustain or defeat the claim or demand, hut as to any other admissible and essential matter which might have been offered for that purpose. (Pakas v. Hollingshead, 184 N. Y. 211, 217; Cromwell v. County of Sac, supra.)
Even assuming, and it is not olear that this is so, that the subsequent action proceeds on ¾ different theory, the prior judgment may, nevertheless, be a bar. A judgment on the merits precludes another action based on the same foundation facts—in a special sense, the same cause of action — even though a different theory for similar relief is set forth (Schuylkill Fuel Corp. v. Nieberg Realty Corp., 250 N. Y. 304; Restatement, Judgments, § 63). The situation is not to be confused with one where a plaintiff pursues an erroneous remedy and his complaint is dismissed because the remedy is unavailable as the wrong one. Then it is true that a plaintiff is not barred from bringing another action pursuing the proper remedy, (Henry v. Herrington, 193 N. Y. 218, 222-223; Mercury Mach. Imp. Corp. v. City of New York, 1 A D 2d 337, 341, revd. on other grounds 3 N Y 2d 418; Restatement, Judgments, § 65.)
In this case the prior judgment was on the merits. Both theories were urged by plaintiff in connection with a complaint that was susceptible bf supporting either of the twe theories. Basically involved was the very same remedy in equity, although the formal prayers, which are never determinative, were equivocal and adaptable tb one theory Or the other as suited plaintiff’s legal exigencies.
Finally, it is quite clear that in the prior action plaintiff actually did tender the issue of joint venture. It was essential to the dismissal of the complaint in that action that the court find that there was ño joint venture, If it had found a joint venture, the motion for summary judgment should have been denied because the Statute of Frauds would not be applicable (e.g., Mattikow v. Sudarsky, 248 N. Y. 404). Consequently, even If plaintiff were not barred under the principles already discussed by way of direct estoppel, he would be barred with regard to Ms essential facts by reason of collateral estoppel because those essential facts were in issue and had been 'actually litigated and determined in the prior action (e.g., Griffen v. Keese, 187 N. Y. 454, 456; Southern Pac. R. R. v. TJnited States, 168 U. S. 1, 48; The Evergreens v. Nunan, 141 F. 2d 927, 928-929; Restatement, Judgments, § 68).
Hence, whichever way -one turns in an analysis of the prior judgment, it is a bar to the present complaint.
*664Accordingly, the order denying the motion to dismiss the complaint should he reversed, on the law and on the facts, the motion granted, and the complaint dismissed, with costs to defendants-appellants.
BabiN, FraNk, McNally and SteveNS, JJ., concur.
Order unanimously reversed on the law and on the facts, with $20 costs and disbursements to the appellants and the motion granted, with $10 costs, and judgment directed in favor of defendants dismissing the complaint, with costs.