Motion by the plaintiff, Citibank, N.A., for leave to reargue appeals from an order of the Supreme Court, Nassau County, *306entered December 22, 2002 and from an amended judgment of foreclosure and sale of the same court dated February 25, 2003, which were determined by decision and order of this Court dated August 9, 2004 [10 AD2d 377].
Upon the papers filed in support of the motion and the papers filed in opposition and relation thereto, it is
Ordered that the motion is granted, and upon reargument, the decision, and order of this Court dated August 9, 2004 is recalled and vacated, and the following decision and order is substituted therefor:
In an action to foreclose a mortgage, the defendant Renate Kenney appeals, as limited by her brief, from (1) so much of an order of the Supreme Court, Nassau County (Winslow, J.), entered December 22, 2002, as, upon granting the plaintiffs motion for summary judgment and denying her cross motion for summary judgment, established the order of priority in which the proceeds from the foreclosure sale were to be distributed, and (2) so much of an amended judgment of foreclosure and sale of the same court dated February 25, 2003, as, in effect, directed that the junior liens held by Citibank, N.A., Renate Kenney, and Lake Highlands, L.E, attach to the surplus funds in order of their priority as set forth in the order entered December 22, 2002.
Ordered that the appeal from the order dated December 22, 2002, is dismissed; and it is further,
Ordered that the amended judgment is affirmed insofar as appealed from, with costs.
The appeal from the intermediate order must be dismissed because the right of direct appeal therefrom terminated with the entry of the amended judgment in the action (see Matter of Aho, 39 NY2d 241, 248 [1976]). The issues raised on appeal from the order are brought up for review and have been considered on appeal from the amended judgment (see CPLR 5501 [a] [1]).
The plaintiff, Citibank, N.A. (hereinafter Citibank), commenced this action in 2000 to foreclose a mortgage originally recorded in 1987, which was consolidated with a second mortgage in 1993 and subsequently amended and restated in 1997 in the amount of $113,150.95 (hereinafter the Senior Mortgage). The priority of the Senior Mortgage, which encumbers all of the subject premises (known as Section 63, Block 66, Lots 51 through 64 on the Nassau County Tax Map), is undisputed.
In 1987 Citibank also obtained and recorded a separate mortgage, in the amount of $750,000, which originally encum*307bered only part (i.e., lots 51 through 61) of the subject premises, but which was later extended, in or about January 1993, to cover all of the subject premises (hereinafter the original mortgage). Subsequently, in March 1993, the defendant Renate Kenney obtained and recorded a mortgage in the amount of $170,000, which encumbered all of the subject premises (hereinafter the Kenney mortgage). Approximately one month later, the defendant Small Business Administration (hereinafter the SBA) recorded a mortgage, which was later amended and restated in the amount of $143,400, encumbering part of the subject premises (hereinafter the SBA mortgage).
In 1994 Citibank’s agent erroneously executed and recorded an instrument discharging the original mortgage. According to Citibank, this error was discovered in the latter part of 1996. Instead of seeking to reinstate the original mortgage to its former status and priority, Citibank, in 1997, obtained and recorded a new mortgage in the amount of $694,753.73, encumbering all of the subject premises (hereinafter the replacement mortgage). For purposes of establishing the seniority of the replacement mortgage, Citibank attempted to contractually subordinate both the SBA mortgage and the Kenney mortgage. However, Citibank was unable to obtain a subordination agreement from the SBA, and has not produced a duly executed subordination agreement with respect to the Kenney mortgage. In 2001 the SBA mortgage was assigned to the defendant Lake Highlands, L.E (hereinafter Lake Highlands).
While conceding that the seniority of the replacement mortgage could not be established vis-a-vis Lake Highlands, Citibank contended that the Kenney mortgage should be equitably subordinated to the replacement mortgage. The Supreme Court agreed and, in the order appealed from, determined that the replacement mortgage had priority over the Kenney mortgage but not over the SBA Mortgage. As a result, the Supreme Court initially allowed the foreclosure sale to proceed with respect to the senior mortgage, and directed that such sale be free and clear of the Kenney mortgage, but remain subject to both the replacement mortgage and the SBA mortgage. However, pursuant to a stipulation entered into by the parties, the Supreme Court entered an amended judgment of foreclosure ordering the sale of the subject premises to proceed free and clear of the liens created, inter alia, by the Kenney mortgage, the SBA mortgage, and the replacement mortgage, and directing that such liens attach to any surplus funds arising from the sale, after repayment, inter alia, of the senior mortgage. Therefore, the only remaining issue to be determined on appeal *308is the order of priority among the replacement mortgage, the Kenney mortgage, and the SBA mortgage for purposes of allocating the surplus funds.
Under the circumstances presented here, the Supreme Court correctly determined that Citibank’s lien had priority over Kenney’s. To be sure, when Citibank discovered in 1996 that the original mortgage had been erroneously discharged, it had the right to seek the reinstatement of the original mortgage to its former status and priority, as neither Kenney nor the SBA had changed their positions in reliance on the validity of the prior discharge (see Application of Ditta, 221 NYS2d 34 [Sup Ct, Kings County, Oct. 11, 1961, Cohn, J.]). Contrary to Kenney’s contentions, Citibank’s decision to enter into the replacement mortgage in lieu of moving to reinstate the original mortgage does not compel the conclusion that Citibank waived its seniority under the originad mortgage. The inadvertent discharge of the original mortgage, without concomitant satisfaction of the underlying debt, did not extinguish Citibank’s security interest; rather, it left Citibank with an unrecorded, equitable lien, which Citibank could have enforced by way of foreclosure (see Federal Deposit Ins. Corp. v Five Star Mgt., 258 AD2d 15, 21 [1999]; Sullivan v Corn Exch. Bank, 154 App Div 292, 296 [1912]). Moreover, the subsequent creation by Citibank of a duly perfected mortgage (i.e., the replacement mortgage) encumbering the same premises and securing a restructured version of the same underlying debt did not, under the circumstances, operate as a waiver of Citibank’s prior equitable lien or as a merger of such lien into the subsequent replacement mortgage. Accordingly, because Kenney never changed her position in reliance on the inadvertent discharge of the original mortgage, there was no basis in equity to deny the continued seniority of Citibank’s equitable lien over the Kenney mortgage (see Payne v Wilson, 74 NY 348, 353-354 [1878]).
The parties’ remaining contentions are without merit. Cozier, J.P., Luciano, Mastro and Spolzino, JJ., concur.