In a proceeding pursuant to CPLR article 78 to review a determination of the respondent Zoning Board of Appeals of the Village of East Hampton dated September 24, 2004, which, after a hearing, annulled those portions of a certificate of occupancy, issued October 29, 2003, relating to the petitioner’s use of an outdoor dining area with accompanying structural improvements, and the use of a barn as a dormitory with accompanying structural improvements, the petitioner appeals from a judgment of the Supreme Court, Suffolk County (Emerson, J.), dated May 2, 2005, which denied the petition and dismissed the proceeding.
Ordered that the judgment is modified, on the law, by deleting the provision thereof denying the petition in its entirety, and substituting therefor a provision granting the petition to the extent of annulling so much of the determination dated September 24, 2004, as annulled those portions of the certificate of occupancy relating to the presence of a patio awning on the premises and the use of a barn as a dormitory with accompanying structural improvements, both as described in a prior resolution of the respondent Zoning Board of Appeals of the Village of East Hampton filed May 14, 2001, and otherwise denying the petition; as so modified, the judgment is affirmed, without costs or disbursements.
The petitioner operates an inn and restaurant at the subject premises in the Village of East Hampton as a preexisting nonconforming use under the local zoning ordinance. It is undisputed that in 1987 the petitioner was issued a building permit for the construction of a large awning over a patio on the premises. Moreover, in 1989, a certificate of occupancy (hereinafter C.O.) was issued for the property which approved an *802existing barn on the premises as “a detached two-story frame building occupied as help’s quarters—first floor contains three bedrooms and second floor contains four bedrooms and living room.” Thereafter, a 1993 C.O. again approved both the presence of the awning and the use of the barn as living quarters, describing them as “[a] slate patio partially covered with an awning, and [a] legal preexisting nonconforming two-story frame building occupied as help’s quarters—first floor consists of two bedrooms and a bath, second floor consists of three bedrooms, bath and living room.”
On June 22, 2000, in response to various complaints from neighboring residents, the village code enforcement officer rendered a determination finding, inter alia, that the patio awning had been approved and permitted in 1987, and that the barn’s use as a dormitory had been authorized in previous C.O.s. The determination advised the residents to seek any further redress regarding these matters from the village Zoning Board of Appeals (hereinafter the ZBA). The residents appealed the determination to the ZBA, which rejected their arguments in a resolution filed May 14, 2001. With regard to the claims of the residents that the patio awning violated the zoning ordinance and that the barn was being used unlawfully as living quarters for employees of the inn, the ZBA determined that “the statute of limitations has long expired” because “[t]he underlying determinations which aggrieve the applicants are the building permit for the awning, issued April 17, 1987, and the certificate of occupancy for the ‘help’s quarters,’ issued September 6, 1989.”
On October 29, 2003 the village code enforcement officer issued another C.O. for the premises which again acknowledged that the patio was partially covered by an awning and that the barn was being used as a “dormitory/storage building.” In addition, the 2003 C.O. recited for the first time that the partially covered patio was being used as an “outdoor dining patio.”
Neighboring residents of the inn again appealed to the ZBA contending, inter alia, that the use of the patio as an outdoor dining area and the use of the barn as living quarters, as well as the structural changes made to the premises to accommodate those uses, violated the zoning ordinance. In a determination dated September 24, 2004, the ZBA agreed with the residents and adopted a resolution annulling those portions of the 2003 C.O. authorizing these uses and improvements. The ZBA concluded, inter alia, that the outdoor dining and dormitory uses were not preexisting nonconforming uses and did not constitute valid accessory uses.
*803The petitioner thereafter commenced this proceeding pursuant to CPLR article 78 to review the ZBA’s determination. The Supreme Court denied the petition and dismissed the proceeding, finding that the ZBA’s determination was rational and that the ZBA was not bound by its 2001 determination rejecting similar challenges by the neighboring residents as time-barred. We modify the judgment.
We agree with the Supreme Court that the ZBA properly annulled that portion of the 2003 C.O. relating to the use of the patio for outdoor dining. The petitioner failed to demonstrate that the use of the patio for outdoor dining was a preexisting nonconforming use at the time that the zoning ordinance of the Village of East Hampton was enacted. Furthermore, the ZBA’s determination that the utilization of the patio for outdoor dining was not a proper accessory use under the ordinance is entitled to great deference (see Matter of New York Botanical Garden v Board of Stds. & Appeals of City of N.Y., 91 NY2d 413, 420 [1998]; Verstandig’s Florist v Board of Appeals of Town of Bethlehem, 229 AD2d 851, 852 [1996]), and we discern no basis in the record for disturbing that determination. Additionally, there is no evidence that a special permit or a use variance was ever issued to authorize outdoor dining in the patio area. Accordingly, the Supreme Court properly deferred to the ZBA’s determination that the use of the patio for outdoor dining was an illegal nonconforming use.
By contrast, to the extent that the ZBA annulled those portions of the 2003 C.O. relating to the barn’s use as living quarters and its accompanying structural improvements, as well as to the patio awning which was the subject of the 1987 building permit, the determination was contrary to law because the 2001 determination of the ZBA was entitled to res judicata effect with regard to those matters. It is true, as the respondents observe, that where a local building inspector improperly issues a C.O., and as a result the property owner acts in violation of the zoning ordinance, a zoning board of appeals may nevertheless correct the mistake by enforcing the zoning ordinance (see Matter of Elichar Realty Corp. v Town of Eastchester, 150 AD2d 444 [1989]). Indeed, <c[e]stoppel is not available against a local government unit for the purpose of ratifying an administrative error” (Morley v Arricale, 66 NY2d 665, 667 [1985]), and “ ‘[a] municipality, it is settled, is not estopped from enforcing its zoning laws either by the issuance of a building permit or by laches’ ” (Matter of Parkview Assoc. v City of New York, 71 NY2d 274, 282 [1988], cert denied 488 US 801 [1988], quoting City of Yonkers v Rentways, Inc., 304 NY 499, 505 [1952]). However, *804while the ZBA may enforce the zoning ordinance, even in light of a mistake by the code enforcement officer, the principles of res judicata and collateral estoppel apply to quasi-judicial determinations of administrative agencies, such as zoning boards, and preclude the relitigation of issues previously litigated on the merits (see Ryan v New York Tel. Co., 62 NY2d 494 [1984]; Matter of Timm v Van Buskirk, 17 AD3d 686 [2005]; Matter of Waylonis v Baum, 281 AD2d 636 [2001]).
Under the circumstances of this case, the doctrine of res judicata bars a challenge to the use of the barn as living quarters, as well as to the accompanying structural improvements and the patio awning as they existed at the time of the ZBA’s previous 2001 determination. In that 2001 determination, the ZBA specifically rejected the challenges to those matters on the ground that they were barred by the statute of limitations. A dismissal on the ground of untimeliness “is at least sufficiently close to the merits for claim preclusion purposes to bar a second action” (Smith v Russell Sage Coll., 54 NY2d 185, 194 [1981]; see Matter of Koeppel v Wachtler, 183 AD2d 829 [1992]). As the ZBA’s 2001 dismissal of the challenges as untimely constituted a final determination on the merits, those same challenges could not be raised in this proceeding, nor could the ZBA revisit them. Accordingly, the Supreme Court should have granted the petition in part and annulled the ZBA’s determination to the extent that it annulled those portions of the 2003 C.O. relating to the use of the barn as a dormitory, the structural improvements made in connection with that use, and the patio awning. Goldstein, J.P., Mastro, Rivera and Lunn, JJ., concur.