Appeal from an order of the Supreme Court, Erie County (Shirley Troutman, J.), entered May 5, 2014. The order dismissed the complaint upon defendants’ motion.
It is hereby ordered that the order so appealed from is unanimously affirmed without costs.
Memorandum: In a prior appeal (Reynolds v Krebs, 81 AD3d 1269 [2011]), we concluded that Supreme Court erred in granting that part of defendants’ motion for summary judgment dismissing plaintiff’s cause of action alleging that defendants were negligent, inter alia, in ordering the demolition of a building owned by plaintiff. The court thereafter granted defendants’ motion for leave to amend their answer to add the affirmative defense of governmental immunity, and upon defendants’ subsequent motion, granted defendants summary judgment dismissing the complaint based on that defense (see CPLR 5501 [a] [1]; Oakes v Patel, 20 NY3d 633, 644-645 [2013]). Plaintiff’s contention that the court erred in granting defendants’ motion for leave to amend their answer is brought up for our review on his appeal from the order granting defendants summary judgment dismissing the complaint.
Plaintiff contends that defendants are barred by the doctrine of judicial estoppel from raising the affirmative defense of governmental immunity because they allegedly asserted in a prior federal action that an adequate postdeprivation remedy was available in a state court action (Reynolds v Krebs, 336 Fed Appx 27 [2d Cir 2009]). “ ‘The doctrine of judicial estoppel provides that where a party assumes a position in a legal proceeding and succeeds in maintaining that position, that party may not subsequently assume a contrary position because [the party’s] interests have changed’ ” (Popadyn v Clark Constr. & Prop. Maintenance Servs., Inc., 49 AD3d 1335, 1336 [2008]). Here, however, defendants did not allege as a basis for summary judgment in the federal action that a negligence action would provide an adequate remedy but, instead, argued that there was no dispute that there was an adequate remedy in state court (Reynolds, 336 Fed Appx at 29). Thus, we conclude that the court did not abuse its discretion in granting defendants’ motion for leave to amend their answer to allege as an affirmative defense that the determination to demolish plaintiff’s building was protected by the *1257doctrine of governmental immunity (see generally Carro v Lyons Falls Pulp & Paper, Inc., 56 AD3d 1276, 1277 [2008]).
We reject plaintiff’s further contention that the court erred in granting summary judgment dismissing the complaint. It is well established that “an agency of government is not liable for the negligent performance of a governmental function unless there existed ‘a special duty to the injured person, in contrast to a general duty owed to the public.’ Such a duty . . . — ‘a duty to exercise reasonable care toward the plaintiff’ — is ‘born of a special relationship between the plaintiff and the governmental entity’ ” (McLean v City of New York, 12 NY3d 194, 199 [2009]; see Bower v City of Lockport, 115 AD3d 1201, 1202-1203 [2014], lv denied 24 NY3d 905 [2014]). Defendants established their entitlement to summary judgment dismissing the complaint on the ground that they did not owe a special duty to plaintiff (see Valdez v City of New York, 18 NY3d 69, 75 [2011]; Bower, 115 AD3d at 1202-1203), but instead acted under their police power to protect the general public. In opposition to defendants’ motion, plaintiff failed to raise an issue of fact that defendants owed him a special duty (see generally Zuckerman v City of New York, 49 NY2d 557, 562 [1980]), and indeed, failed even to allege that defendants owed him a special duty (cf. Bower, 115 AD3d at 1203).
We further conclude, in any event, that defendants are also entitled to summary judgment based on the defense of governmental function immunity (see Bower, 115 AD3d at 1203). “That defense ‘shield[s] public entities from liability for discretionary actions taken during the performance of governmental functions’ ” (id., quoting Valdez, 18 NY3d at 76; see Haddock v City of New York, 75 NY2d 478, 484 [1990]). Here, section 77-11 of the Code of the Village of Springville affords the mayor the discretion to demolish a building in an emergency situation.
Present — Whalen, P.J., Smith, NeMoyer, Cur-ran and Scudder, JJ.