OPINION OF THE COURT
Kane, J. P.Defendants Bonded Concrete, Inc., and Troy Sand and Gravel Company, Inc. (hereinafter defendants), operate a gravel pit in the Town of Rotterdam, Schenectady County. *169The pit is located over the Rotterdam Aquifer, which supplies water to various Schenectady and Saratoga County communities. Plaintiff utilizes a large amount of water from the aquifer in its daily operation. In November 1979, defendants obtained a mining permit from the Department of Environmental Conservation (hereinafter DEC) following a "negative declaration” from DEC that no environmental impact statement was needed before the issuance of the permit. In December 1979, defendants commenced their gravel extraction operation.
On January 15, 1980, plaintiff commenced what it termed a "combined action/proceeding (CPLR article 78)”. In the CPLR article 78 portion of its action/proceeding, plaintiff sought a determination annulling DEC’s issuance of the mining permit and the negative declaration. In the other portion of its action/proceeding, plaintiff sought damages and a permanent injunction. Pending resolution of its action/proceeding, plaintiff moved for a preliminary injunction enjoining defendants from mining any additional gravel from the Rotterdam site. Special Term granted plaintiff’s application upon the condition that plaintiff post an undertaking in the amount of $500,000 (see, CPLR 6312 [b]). In addition, Special Term severed the article 78 proceeding from plaintiff’s action seeking a permanent injunction and money damages. The action has not yet gone to trial. However, in July 1980 Special Term ruled that DEC’s issuance of the negative declaration and the mining permit was not arbitrary and capricious (Schenectady Chems. v Flacke, 104 Misc 2d 1079) and, accordingly, dismissed the article 78 proceeding. Plaintiff appealed to this court; we reversed, annulled the mining permit issued to defendants and remitted the matter to DEC (Matter of Schenectady Chems. v Flacke, 83 AD2d 460).
In due course, DEC ruled that defendants were required to file a draft environmental statement before DEC could reconsider defendants’ application for a mining permit. Following hearings, defendant Commissioner of DEC concluded that:
"The state of the existing record of this proceeding precludes preparation of a final environmental impact statement in accordance with the requirements of ECL Article 8, State Environmental Quality Review Act CSEQRA’) at this time. Several important environmental issues have been resolved. The Report concludes that mining sand and gravel will have no significant adverse effect on the quality and quantity of water available in the aquifer and that noise, traffic and air impacts would also not be significant. However, as a conse*170quence of the noted deficiencies concerning the reclamation and mining plans, the Report concludes that the long term effects of the presence of the lake on water quality cannot reasonably be predicted. In addition, no attempt has been made to evaluate the feasibility of alternative size or configurations of the areas on the Site to be mined * * *
"In addition to the above matters it is apparent that there is a sparse record on the need for this Project.”
The Commissioner, therefore, denied defendants’ application without prejudice to their right to reapply.*
Based on DEC’S denial of defendants’ mining permit, plaintiff moved to have Special Term terminate any liability which it might have had to defendants, in addition to discharging its surety, Aetna Casualty Insurance Company, on the bond. Defendants joined in plaintiff’s request to have Special Term determine plaintiff’s liability to defendants, but asserted that plaintiff should be held liable to defendants as DEC’s determination was in their favor. Special Term, following reargument and without opinion, granted plaintiff’s motion to the extent that the liability of its surety on the bond was terminated. Special Term, however, expressly refused to determine the liability between plaintiff and defendants. Defendants appeal from that portion of the order which terminated the liability of plaintiff’s surety on the bond.
The purpose of an undertaking is "[t]o afford reasonable protection to defendants from an erroneous grant of a preliminary injunction” (Price v Erie County Bd. of Elections, 72 AD2d 969, 970). The undertaking in this case was ordered pursuant to CPLR 6312 (b), which states that: "prior to the granting of a preliminary injunction, the plaintiff shall give an undertaking in an amount to be fixed by the court, that the plaintiff, if it is finally determined that he was not entitled to an injunction, will pay to the defendant all damages and costs which may be sustained by reason of the injunction”. The Court of Appeals has ruled that the phrase "determined that he was not entitled to an injunction”: "refers to a final determination that the plaintiffs were not entitled to the preliminary injunction, rather than a determination with respect to their right to a permanent injunction or other favorable outcome on the merits of the main action. The proper focus is on the propriety of the issuance of the *171preliminary injunction when it was granted at. the commencement of the action” (Margolies v Encounter, Inc., 42 NY2d 475, 479 [footnote omitted]).
As noted above, Special Term discharged the surety without rendering a written decision and without determining the liability between plaintiff and defendants. Since the undertaking is defendants’ basis for damages (cf. Honeywell, Inc. v Technical Bldg. Servs., 103 AD2d 433), discharging plaintiffs undertaking without deciding the issue of plaintiff’s liability upon the undertaking was error. Special Term was required to determine whether the preliminary injunction was improvidently granted. The record fails to indicate that Special Term made any determination upon this issue and, indeed, its order indicates otherwise. That portion of the order being appealed which discharged the surety on the undertaking must, therefore, be reversed, and the matter remitted to Special Term for further proceedings not inconsistent herewith.
We note that plaintiff’s action for a permanent injunction is moot, as defendants do not have a permit to pursue their mining activities. Finally, we observe that DEC’s determination denying defendants’ mining permit application without prejudice, contrary to the parties’ mutual argument, is not a determination regarding plaintiff’s entitlement to the preliminary injunction at the time it was granted.
Main, Casey, Weiss and Levine, JJ., concur.
Order modified, on the law, without costs, by reversing so much thereof as partially granted plaintiffs motion to discharge the surety on the undertaking; undertaking reinstated and matter remitted to Special Term for further proceedings not inconsistent herewith; and, as so modified, affirmed.
Defendants inform us that they intend to reapply for a permit. However, as of the date of their brief, they had not yet reapplied.