OPINION OF THE COURT
Eli Wager, J.This motion to dismiss the complaint is denied.
Rudolph L. Mazzei, the defendant in this action to recover $12,500 allegedly lent him in 1977 by the plaintiff’s assignor, moves to dismiss the complaint on the ground that the court lacks subject matter jurisdiction and that the complaint fails to state a cause of action. Defendant alleges in his affidavit — in conclusory fashion — that the money was advanced to him by the MGM Grand Hotel in Las Vegas, Nevada (plaintiff’s assignor) exclusively “for the purpose of casino gambling” and may thus not be recovered in a New York court. The purpose of the loan does not appear on the face of the complaint and defendant’s answer (dated August 11, 1983) consists only of denials. Thus, the threshold issue is whether defendant’s failure to plead the defense or to move before the time to answer had expired constitutes a waiver pursuant to CPLR *7813211 (subd [e]). A resolution of that issue depends upon whether the defense of illegality (see Molina v Games Mgt. Servs., (89 AD2d 69; General Obligations Law, § 5-401) comes within the ambit of CPLR 3211 (subd [a], pars 2, 7) or whether it is an affirmative defense which must be pleaded (CPLR 3211, subd [a], par 5).
Where illegality appears on the face of the complaint, a motion to dismiss for failure to state a cause of action (CPLR 3211, subd [a], par 7) is proper (see McCall v Frampton, 99 Misc 2d 159) and recovery may be barred even where defendant has failed to plead the defense (see, e.g., Attridge v Pembroke, 235 App Div 101; Radney v Schor, 41 Misc 2d 789). However, the presumption is that contracts are legal (and enforceable) and illegality is a defense to be pleaded unless it appears on the face of the complaint (Brearton v De Witt, 252 NY 495; Morgenstern v Cohon, 2 NY2d 302; Vrooman v Village of Middleville, 106 Misc 2d 945; Bishop Estates v Murphy, 41 Misc 2d 719; see CPLR 3018, subd [b]). It has been held that a trial court may refuse to enforce a contract when it becomes apparent from the evidence adduced that the agreement is antagonistic to the public interest, despite a defendant’s failure to plead (Klein v Comenzo Co., 207 NYS2d 739; see, also, Dodge v Richmond, 10 AD2d 4). Similarly, when such evidence is presented on a motion for summary judgment the defendant’s failure to plead will not bar summary disposition (see Carlson v Travelers Ins. Co., 35 AD2d 351).
Since the unenforceability of the instant contract does not appear on the face of the complaint, the defense must be treated as an affirmative defense pursuant to CPLR 3211 (subd [a], par 5) and is thus subject to waiver. As noted above, such a waiver may be ignored by the trial court if the evidence indicates that the contract should not be enforced, but the necessary evidence does not appear in the record as it presently exists.
A gambling debt will not be enforced in New York unless it was validly contracted in another jurisdiction and is enforceable there (Aspinalls Club v Aryeh, 86 AD2d 428). In Nevada, debts incurred and checks drawn for gambling purposes are void and unenforceable (Sea Air Support v Herrmann, 96 Nev 574). The Nevada courts, however, *782require consideration of the surrounding circumstances in order to determine that money was advanced solely for the purpose of gambling and not for some other legitimate purpose (National Recovery Systems v Wonder, 118 Misc 2d 1098; see, e.g., Wolpert v Knight, 74 Nev 322; Flamingo Resort v United States, 485 F Supp 926, affd 664 F2d 1387). Defendant’s conclusory statement that the money plaintiff seeks to recover was lent “for the purpose of casino gambling” is not sufficient to enable the court to consider the circumstances as required by the Nevada courts.
Defendant’s additional plea that the court “lacks subject matter jurisdiction” (CPLR 3211, subd [a], par 2) would not be subject to waiver pursuant to CPLR 3211 (subd [e]). The defense, however, is without merit since the court clearly has “competence” to entertain the action (see Lacks v Lacks, 41 NY2d 71). The alleged illegality goes only to the merits of plaintiff’s case.
Since at least one cause of action survives the dismissal motion and the motion is addressed to the complaint as a whole, the motion must be denied (Kaplan v Simone Bros. Auto Body, 77 AD2d 863).