This action was commenced in the year 1875, for the foreclosure of a mortgage made by the Hew York Central Under-Ground Bail-way Company to secure the payment to the plaintiff of a sum exceeding. $90,-*676000, and interest. The mortgagor and certain other parties, having or claiming liens upon the property, with the mayor, aldermen, etc., of the city of New York, were made parties defendant. The complaint alleges the making and execution of the mortgage, with allegations as to the liens of the other defendants, and the description of the property described in the mortgage. The only allegation affecting the respondents is as follows: “The major, aldermen, and commonalty of the city of New York are made defendants in this action, because the plaintiff was informed they might have a claim or interest in tile property covered and conveyed in the two mortgages mentioned, and in the relief demanded in this complaint. No claim or demand is made against the said mayor, aldermen, and commonalty of the city of New York.” The relief demanded is that the plaintiff have judgment against said company for the amount claimed to be due to him; that it be adjudged that the mortgage be foreclosed; that said company, and all claiming under it, be foreclosed of the right to perform certain agreements set up in the complaint; that the mortgaged franchises and property be Sold, and the proceeds of such sale be applied to satisfy the indebtedness due to this plaintiff; that a certain other mortgage, described in the complaint, be canceled and discharged of record; that the company be restrained from issuing bonds under such mortgage, and from incumbering its property; and that the court grant such other and further relief as may be equitable and just in the premises.
The respondents appeared in the action, and demanded service of a copy of the complaint, which was duljT served upon the counsel for the corporation, but they interposed no answer to the complaint. Subsequently an application was made for judgment, and notice thereof was served upon the counsel to the corporation. In pursuance of this notice, and, so far as appears, in tile absence of the counsel to the corporation, an order was entered whereby it was ordered and adjudged that the plaintiff have judgment for the relief demanded in the complaint, and that it be referred to a referee to take proof of the allegation in the complaint, to ascertain the amount due to the plaintiff, and report the facts found by him to the court; and that said referee also take evidence and report upon certain matters referred to in an affidavit of the plaintiff annexed to the notice of the application; and on the referee’s report, dated the 11th of January, 1676, without further notice to the respondents, judgment was entered directing a sale of the mortgaged premises by a referee. In March, 1889, the respondents applied to the court to strike from said judgment each and every other declaration, adjudication, or decree contained therein which is in excess of the prayer for relief specifically asked for by the complaint, and this is an appeal from an order of the special term granting such motion.
This judgment certainly contains extraordinary provisions. In an action brought to foreclose a mortgage upon a franchise it assumes to adjudicate that the mortgagor had performed all the conditions required by the statute granting the franchise; had commenced the construction of its railway; and owned the right to appropriate a large portion of the streets and parks of the city of New York, which tile judgment proceeds to particularly describe, without paying any compensation therefor; and that the purchaser under the sale therein authorized should hold the said mortgaged premises, with the right of occupancy, seizure, and possession, with and for the specific uses, rights, and powers as in the order and report of the referee recited and declared; and this judgment was rendered on the default of the defendants. There was no intimation in the complaint that any attempt would be made, to obtain an adjudication as to the extent of these rights and franchises, or as to their existence at the time of the commencement of the action, or that any judgment should be asked for affecting in any manner the rights of the city of New York to claim that such rights and franchises had been lost *677or forfeited, and no such provision in the judgment was necessary to vest in the purchaser at the sale all rights that the railroad company (the mortgagor) had, either at the time of the execution of the mortgage or at the commencement of the action. So far as the city was concerned, the only relief that could be given by the judgment was the relief asked for in the complaint. Code Proc. § 275.1 For it is a general principle, necessary to the administration of justice, that the complaint must advise the defendant clearly of what is claimed. It is not alone the case as made, but also the judgment asked for, that controls. Swart v. Boughton, 35 Hun, 284; Kelly v, Downing, 42 N. Y. 78.
Appellant insists, however, that the adjudication of a fact is no part of the relief which the court grants; that the relief is “the executive action to be taken by the court in accordance with the justice of the cause, as required by the facts found. It had no reference whatever to the effect of the judgment by way of estoppel." As to the facts which must exist to entitle plaintiff to the relief granted, it is clear that granting the relief is an adjudication that such facts exist. Thus, in an action upon a promissory note, a judgment for the plaintiff for the amount is an adjudication that there was a valid note, a consideration given, and that the whole amount was due, and the relief granted would be a judgment that plaintiff recover of defendant the amount, tío, in this action to grant the relief that was asked for, it was necessary to find as a fact that the mortgage was made by defendant, and that there was a certain sum due thereon, and as to those facts the estoppel of the judgment applied. But it was not necessary, to entitle plaintiff to such relief, to find that the defendant railroad company had built a part of the road, or that in another action, to which this defendant was not a party, it had been adjudged that the railroad company had located its road and commenced its construction and owned the property. The existence of those facts not being alleged in the complaint, and not being necessary to entitle the plaintiff to the relief for which he had asked, an adjudication as to the existence of those facts had no relation to the foreclosure of the mortgage, the relief demanded in the complaint; and if the court in the judgment made such an adjudication by decreeing that such facts did exist, such an adjudication was only effectual to create an estoppel, and was of itself relief in addition to that demanded in the complaint. The plaintiff was therefore entitled to a judgment appropriating the interest of the mortgagor to the payment of the amount secured by his mortgage, and any interest the city had in the property, subsequent to the mortgage, was cut off by the judgment. The city had no answer to a demand for such a judgment, and could not have interposed a defense to the action; but any attempt of the court to adjudicate that such rights did exist was, so far as it affected this defendant, without jurisdiction in this action. It is settled that in an action for the foreclosure of a mortgage the rights of parties who claim in priority or in hostility to the mortgagor cannot be litigated, and that a judgment of foreclosure granted by default only affects the interests of those subsequent to the mortgage; that the decree does not affect rights paramount to those of the mortgagor and the mortgagee. Bank v. Thomson, 55 N. Y. 7; Rathbone v. Hooney, 58 N. Y. 463; Bank v. Goldman, 75 N. Y. 127. Nor is there the slightest doubt as to the power of the court to set aside or modify the judgment at any time. As was said by the court of appeals in Hatch v. Bank, 78 N. Y. 490: “These * * * cases show the power of the court over its own judgment, and its habit to exercise it in aid of justice, and it is an inherent power, and not limited in matters of substance by the sections of the Code. ” 27or do I think the application was made too late. The defendant is a municipal corporation, and, so far as appears, the judgment was never served upon the law officer of the eorpora*678tíón; and the fact that other officers of the corporation had notice of the judgment, or that in any other proceedings the attention of the law officers of the corporation was called to this judgment, did not, under the circumstances, make it improper for the court, in the exercise of its discretion, to amend the judgment. Nor do the rights of third parties require that this application should have been denied. One of the purchasers at the sale by the referee was the plaintiff in the action. He must be chargeable with knowledge of the irregular form of the judgment, and a purchaser from him can acquire no greater rights than he had. The voluminous briefs submitted by the appellants have been considered, but we are satisfied that it would be a gross injustice to the city and to the public to have allowed this judgment, as originally entered, to stand, and the court below was right in the exercise of its discretion vested in it in granting the application. Order appealed from should be affirmed, with costs. All concur.
Code Civil Proc. § 1207, contains the corresponding provision.