Levine, J. Appeal from an order of the Supreme Court (Keniry, J.), entered January 28, 1992 in Rensselaer County, which granted defendant Town of Schodack’s motion to set aside the verdict.
In July 1988 plaintiff, an infant, was seriously injured when he was struck while bicycling on Palmer Road in the Town of Schodack, Rensselaer County, by a car driven by defendant Kimberly Keenan. Suit was subsequently brought on plaintiffs behalf against Keenan and defendant Town of Schodack. The theory of liability asserted against the Town was that it had negligently failed to trim or remove brush, foliage and vegetation along Palmer Road which had become so overgrown that it obscured the visibility of motorists along the highway and thereby contributed to the happening of the accident. The Town served an answer containing an affirmative defense setting forth the prior written notice of defect requirements of Town Law § 65-a and alleging that plaintiff had not complied with those requirements.
The case proceeded to trial before a jury. The action against Keenan was settled during plaintiffs proof. Plaintiff introduced evidence tending to establish the exception to the prior written notice requirement contained in Town Law § 65-a, namely, that the "defective, unsafe, dangerous or obstructed condition [along Palmer Road] existed for so long a period that the same should have been discovered and remedied in the exercise of reasonable care and diligence”.
After plaintiffs case was concluded, the Town put on its Superintendent of Highways to testify concerning maintenance on Palmer Road, read portions of plaintiffs examination before trial and then rested "other than to read into evidence a particular portion of the Schodack Town Law”, which was deferred until the opening of court the following morning. After a charge conference that morning, counsel for *631the Town informed the court that he "would like to finish my proof in the case by offering into the evidence from the Code of the Town of Schodack, New York, section 154-1, adopted by the Town Board of the Town of Schodack on July 8, 1976”. He thereupon asked Supreme Court to take judicial notice of Town Code § 154-1 and read it verbatim into the record. Section 154-1 requires prior written notice of a defective condition before any action can be maintained against the Town for injuries caused by that condition, but does not contain the constructive notice exception of Town Law § 65-a. Plaintiff objected, claiming surprise and prejudice in thus having been prevented from employing pretrial discovery to ascertain whether Town Code § 154-1 had been validly adopted. The court reserved decision on the admissibility of Town Code § 154-1 and on the Town’s motion to dismiss the complaint based upon plaintiff’s noncompliance with the notice requirement of that section.
The case was then submitted to the jury which found that plaintiff had suffered $250,000 in damages and apportioned fault 30% to plaintiff, 60% to Keenan and 10% to the Town. After receiving written submissions from the parties, Supreme Court rendered a decision that determined that Town Code § 154-1 applied and that plaintiff’s failure to prove the Town’s receipt of prior written notice of the unsafe condition of Palmer Road was fatal to his case. Accordingly, Supreme Court granted the Town’s motion to set aside the verdict and dismissed the complaint. Supreme Court rejected plaintiff’s objection based on surprise and prejudice from the Town’s belated interposition of Town Code § 154-1. The court reasoned that because compliance with an applicable local law requiring prior notice of defect is a condition precedent to suit, which plaintiff was required to plead and prove, he may not complain of the Town’s failure to alert him earlier of the existence of the requirements of Town Code § 154-1. This appeal by plaintiff followed.
We reverse. Supreme Court was undoubtedly correct in holding that compliance with the Town’s prior written-notice-of-defect law was a condition precedent to plaintiff’s maintenance of this action and, thus, noncompliance was not an affirmative defense as to which the Town had any burden to put plaintiff on notice (see, Cipriano v City of New York, 96 AD2d 817, 818). In our view, however, Supreme Court gave too little weight to the fact that the Town did plead as an affirmative defense noncompliance with the notice requirement of Town Law § 65-a, under the provisions of which *632constructive notice of the defective condition on the part of a municipality is an exception to the requirement of prior written notice. Although pleading an objection based upon Town Law § 65-a " 'had the effect of gratuitously advising [plaintiff] of the apparent insufficiency of the * * * complaint and avoiding surprise’ ” (supra, at 818, quoting Schwartz v Turkin, 115 Misc 2d 829, 833), it also implicitly represented that Town Law § 65-a was the only notice statute that was applicable, thereby lulling plaintiff into assuming that any prior written notice requirement could be overcome by his proof of the Town’s constructive notice.
Thus, when the Town introduced Town Code § 154-1 as the controlling notice requirement, it drastically changed its position at a stage in the litigation when plaintiff was not able to counter it, e.g., by establishing through pretrial discovery that the Town’s local law on notice of defect had not been validly adopted. New York applies the doctrine of judicial estoppel to prevent a party from inequitably adopting a position directly contrary to or inconsistent with an earlier assumed position in the same proceeding or a prior proceeding (see, Tymon v Linoki, 16 NY2d 293, 297; Liebowitz v Arrow Roofing Co., 259 NY 391, 396; Fryczynski v Niagara Frontier Transp. Auth., 116 AD2d 979, 980; Karasik v Bird, 104 AD2d 758, 759). This doctrine has been applied in instances where one party has been misled by averments in the other party’s pleadings (see, Linton v Unexcelled Fireworks Co., 124 NY 533, 537; Northern Bank v Lowenstein, 150 NY Supp 686, 688; 57 NY Jur 2d, Estoppel, Ratification, and Waiver, § 52, at 79). In our view it is appropriate to apply the doctrine here, estopping the Town from its changing position regarding the efficacy of constructive notice of defect when it belatedly introduced Town Code § 154-1 at the conclusion of the proof. Consequently, the order should be reversed and the verdict in plaintiff’s favor reinstated.
Weiss, P. J., and Harvey, J., concur.