In an action to recover money due pursuant to an undisclosed agreement related to a contract for the sale of real property, the plaintiffs appeal from an order and judgment (one paper) of the Supreme Court, Suffolk County (Gowan, J.), entered June 16, 1992, which, inter alia, granted the defendant’s motion for summary judgment, denied the plaintiffs’ cross motion for leave to serve an amended complaint, and dismissed the complaint.
Ordered that the order and judgment is reversed, on the law, with costs, the defendant’s motion for summary judgment is denied, the plaintiffs’ cross motion for leave to serve an amended complaint is granted, the complaint is reinstated, and the plaintiffs are granted leave to serve an amended complaint; and it is further,
Ordered that the appellants’ time to serve an amended complaint is extended until 30 days after the service upon them of a copy of this decision and order, with notice of entry.
The defendant’s motion for summary judgment was made on the eve of trial and was based upon an affirmative defense not asserted in the defendant’s answer, i.e., that the agreement was void because it was made in contemplation of avoiding real estate transfer tax obligations (see, Tax Law § 1400 et seq.). We find that the Supreme Court erred in granting summary judgment on the basis that the agreement in question was illegal (see, Contelmo’s Sand & Gravel v J & J Milano, 96 AD2d 1090; Eschen Steel & Iron Works Co. v Brady & Co., 94 AD2d 605; Furlo v Cheek, 20 AD2d 939), particularly when the evidence presented by the defendant in support of his motion was inadequate to make the required prima facie showing entitling him to summary judgment on the ground asserted (see, Tax Law § 1818; Winegrad v New York Univ. Med. Ctr., 64 NY2d 851; Zuckerman v City of New York, 49 NY2d 557).
*584In light of the fact that the defendant’s motion was made on the day before the trial was scheduled to begin, the Trial Justice stated that he would decide the motion based only upon the defendant’s motion papers and the oral argument of the parties. By precluding the plaintiffs from submitting papers in opposition to the motion, the Trial Justice effectively prevented the plaintiffs from asserting their position that the money due under this separate agreement represented interest due on the purchase money mortgage they had given to the defendant at the time the sale was consummated, and was not a part of the purchase price subject to real estate transfer taxes (see, Tax Law § 1401 [d]; §§ 1402, 1404 [a]). Therefore, we grant the plaintiffs leave to amend the complaint in order to clarify their position (see, CPLR 3025 [b]).
In light of the foregoing, we need not address the parties’ remaining contentions. Sullivan, J. P., Lawrence, Eiber and Santucci, JJ., concur.