It is held in Wells v. Town of Salina, above referred to, that the defendant in that case was not liable to the plaintiff’s testator upon the notes mentioned, nor was it liable in an action at law for money lent and advanced by him, and used to pay the costs and expenses of the action brought by Francis Alvord, at the time supervisor of said town,and Leman B. Pitcher, against the Syracuse Savings Bank and others, holders of the bonds referred to, for their surrender and cancellation, upon the ground that the special contract on the part of the town in relation thereto was illegal. One of the questions to be determined is, conceding, as was held by the court of appeals, that the prosecution of the action of Alvord and Pitcher against the holders of the bonds issued by the town of Salina, to compel their surrender and cancellation, was assumed by said town, and that the same was prosecuted by it and for its benefit, and to relieve itself from its apparent liability on said bonds, and that such action was so prosecuted for a town purpose, within the powers conferred upon town municipalities by the Revised Statutes, is said town, although not liable in an action at law for money advanced to it at its request, because of a want of power in it to enter into said contract, still liable in equity to be charged with the money-so advanced by a stranger in the proceedings, in good faith and actually expended by it in and for a town purpose ? It would seem eminently just that a town which has received the money of a party, advanced to it at its request, in good faith, and relying upon its undertaking to repay the same to the party advancing it, and which money has been applied by the town to discharge its liability incurred in the prosecution of an action for a town purpose, should refund the same to the party advancing it, and thej court should be vigilant in its efforts to discover a way to compel the repayment, if one in fact exists, and the town should not be able to effectually shield itself from its moral liability to pay by invoking the principle of ultra vires. The plea of ultra vires should not, as a rule, prevail, whether interposed for or against a corporation, when it would not advance justice, but, on the contrary, would accomplish a legal wrong. Rider Life Raft *98Co. v. Roach, 97 N. Y., 378. All corporations, whether municipal or business, are the creatures of the statute; every power which they possess, and which they can legally exercise, is derived from the statute; and, while purely artificial in this regard, the same moral obligation to faithfully discharge their undertaking honestly entered into, and being within the purpose for which they were created, exists, binds and controls them the same as natural persons. And while the same rule exists in regard to legal obligations, when applied to contracts made beyond the power and authority conferred in municipal as in business corporations, the rule ultra vires, it seems, is more strictly applied to the former than to the latter. Dill. Man. Corp. §§ 457, 936. In § 936 it is said : “ Where an act, in its external aspect, is within the general powers of a corporation, and is only unauthorized because it is done with a secret, unauthorized intent, the defense of ultra vires will not prevail against a stranger who in good faith dealt with it without notice of such intent. A municipal corporation, as against persons who have acted in good faith, and parted with value for its benefit, cannot, unless by virtue of some statutory provision, set up mere irregularities in the exercise of the power conferred. ” In the case of Hitchcock v. Galveston, 96 U. S., 341, the question of the liability of a municipal corporation upon contracts entered into by it, not within the provisions of the city charter, was considered. In that case the city entered into a contract with the plaintiff to pave certain streets. It had the power to make a valid contract for this purpose, but the city in the contract agreed to make payment for the work in negotiable-city bonds payable at a future day, and it was objected by the city that, since no express power was given to issue bonds for the purpose, the whole contract was inoperative and void. In his opinion, Justice Strong, speaking for the court, among other things says : “ If it be conceded that the city has no power to issue the bonds described in the ordinance and mentioned in the contract, it does not follow that- the contract was wholly illegal and void, or that the plaintiff has no rights under it. It is enough for them that the city council have power to enter into the contract for improving the sidewalks ; that such a contract was made with them; that under it they have proceeded to furnish materials and do work, and assume liabilities; that the city had received, and now enjoys, the benefit of what they have done and furnished; that for these things the city has promised to pay ; and that, after having received the benefit of the contract, the city has broken it. It matters not that the promise to pay was in a manner not authorized by law. If payment cannot be made on bonds because their issue is ultra vires, it would be sanctioning rank injustice to hold that payment need not be made at all. Such is not the case.” In State Board of Agriculture v. Citizens' St. Ry. Co., 47 Ind. 407, it is said that although there may be a defect of power in a corporation to make the contract, yet if a contract made is not in violation of its charter, or of any statute prohibiting it, and the corporation has, by promise, induced a party, relying on the promise and in execution of the contract, to expend money and *99perform his part thereof, the corporation is liable on the contract. To the same effect, Oneida Bank v. Ontario Bank, 21 N. Y., 490, Many other cases might be cited holding the same doctrine.
It is only upon contracts which are ultra vires in the true sense of that expression, that is, upon contracts relating to matters wholly outside of the chartered powers of the corporation, that no liability, legal or equitable, exists against the municipality. The contract in question does not relate to matters wholly outside of the chartered powers of the corporation. On the contrary, it relates to a matter within them, and is only rendered invalid in the manner adopted for procuring the money. The town had the charter power to bring and prosecute an action to rid itself of the alleged liability it had incurred in issuing the bonds, and it had the power, in the way provided by the statute, to raise the money necessary to defray the expenses of such prosecution, viz., by tax levied and collected; but it had not the power to borrow money for that purpose, and it was not, therefore, liable in an action at law for money so borrowed. The money advanced by the plaintiff’s testator was obtained from him for the use of the town of Salina, pursuant to resolutions passed by the inhabitants of said town at regular annual town meetings held therein in the years 1881 and 1882. These seem to have been regularly and legally adopted in pursuance of a power granted the corporation by statute. In supposed execution of the directions contained therein, notes were made, signed by the supervisor in his official capacity. These notes were discounted by the plaintiff’s testator in good faith, and in reliance upon such resolution, incorporated in and forming a part of the notes, and •in the belief that the action of the electors of the town was legal and binding upon it, and that it would discharge the obligation incurred. The money was paid over to the supervisor, or to the attorney, Stephens, and by him expended for and on behalf of the town, to defray the cost and expenses of prosecuting the action brought to annul its bonds, and for a town purpose, and it received the benefit resulting from said prosecution in the refunding of $120,000 of its bonds drawing seven per cent annual interest, and the exchange of other bonds of the town for them drawing but four per cent interest. Under these circumstances, should the town be permitted to repudiate the moral obligation, at least, to pay the money so advanced for its use and benefit, upon the ground that its contract to borrow the money was ultra vires ? Or will this court, in the exercise of its equitable power, charge the town with an equitable obligation to discharge said liability, and to pay the money so advanced ? It will be borne in mind that the money in question could have been raised by the town by tax levied upon the taxpayers therein. They, by their resolutions adopted, expressed their willingness to be taxed for that purpose. The burden is not one, therefore, forced upon them against their will or wishes, but is one willingly assumed. The case is therefore one, as before stated, where the equity power of the court should be exercised to prevent injustice, if such power exists. The broad proposition is asserted by text writers upon *100the subject: “ Persons who have in any way advanced money to a corporation, which money has been devoted to the necessities of the corporation, are considered in chancery as creditors of the corporation, to the extent to which the money has been so expended.” Green’s Brice’s Ultra Vires, 623; Talmage v. Pell, 7 N.Y., 328; Sackett's Harbor Bk. v. Codd, 18 id., 242. The question whether a particular contract is binding on á municipal or public corporation or not is to be tested by determining whether, in the true construction of the charter and the legislation applicable thereto, it relates to matters within the corporate powers and duties. Dill. Mun. Corp. (4th ed.), § 936. The following proposition is advanced, relating, it is true, to dealings with individuals, but in principle it is suggested to he equally applicable to corporations, municipal or otherwise: “ Whenever money is loaned or advanced to a person under disabilities and incapacitated from making a binding contract, as to an infant, lunatic, or the like, and the money is thus loaned or advanced and actually used for the purposes of paying for necessaries or the necessary expenses of the party borrowing, although no legal debt arises, and the lender can maintain no action at law to recover back the amount, yet, since his money was advanced and used for the purpose of paying debts which would -be .recoverable at law, he can sue in the court of equity, and stand in the jfiace of those creditors whose debts have been so paid, and recover back the amount of his advances. An equitable right thus arises upon the principle of subrogation or equitable assignment.” 3 Pom. Eq. Jur., § 1300. See cases cited in note to section. The doctrine of subrogation, being a creature of the courts of equity, is to be so administered as to secure essential justice without regard to form, and is independent of any contractual relations between the parties to be affected by it. McNeil v. Miller, 2 S. E. Rep., 335; Mathews v. Aikin, 1 N. Y., 595. I am therefore of the opinion that the plaintiff in this case, as the executor of Hinsdell, who in good faith, and in reliance upon the action of the inhabitants of the town legally assembled in town meeting, advanced the money for the town, and the same having been used and appropriated for the benefit of the corporation and for town purposes, is entitled to be subrogated to all the rights the creditors who received the money had against it for obligations legally contracted by it for town purposes. The fact that the money advanced by the plaintiff’s testator was used to pay its obligations legally incurred did not operateMo cancel such obligations, so as to prevent such right of subrogation. The plaintiff’s intestate stands in as favorable position to enforce his equitable rights against the town as though he had actually paid its obligations legally incurred to the creditor, and taken an assignment of the demand. The fact that instead of going to the creditor, and paying him, Hinsdell furnished the money to the town, or its attorney in the action, to make such payment, it seems to me, does not in any manner change the rights of the parties. The plaintiff is the actual assignee of the debt owing to Stephens, its attorney in the litigation, for services rendered *101by him, and disbursements made in and about the same, and stands in a position where he can in equity enforce the obligation. In my judgment it would be the extreme of injustice, in light of the fact that the town has received the money in question, and used it, as far as, under the circumstances, it might, to discharge a legal obligation against it, to allow it to say: “ It is true the town was liable for the debt. It is true you, the plaintiff, advanced the money in good faith, and upon our request, with which we discharged the obligations againbt it, but, because we in fact had no legal right to borrow your money for that purpose, wo will not repay you for your advances so made.” I should feel compelled to struggle long and hard to find some way under the circumstances to compel the town to do justice, and I cannot but think a court of equity has jurisdiction of the question, and the power to compel justice to be done.
The more embarrassing question is whether the action brought by the plaintiff against the town, to recover of it for money lent, advanced to it, and at its request, and prosecuted to a final judgment against the plaintiff therein, is a bar to this action. I am disposed, under the circumstances of this case, to hold that it is not. This action differs from the former action in that it is for a different cause of action, this being to force the demands Stephens as attorney had against the town, for services rendered by him, and for money advanced in the prosecution of an action which the town could legally prosecute, and in which it could incur vaild obligations in and about doing so, and to enforce these obligations which the holder could enforce against it, and of which the plaintiff has become the owner, as the equitable, as well as-legal, assignee of the same. Zoeller v. Riley, 100 N. Y., 102 - Calhoun v. Millard, 121 N. Y., 69; 30 St. Rep., 759. As against the claim of Stephens, the attorney for the town, the statute of limitations did not begin to run until the final determination of the action in which the services were rendered and disbursements; made. The case of Alvord v. Bank was argued in the court of appeals on the 11th day of March, 1885, and was decided on the 14th day of April, 1885. 98 N. Y., 599. This action was commenced on the 10tli day of March, 1891. The six-years statute of limitations is therefore not available to the defendant. It appears that at a regular meeting of the town board of the town of Salina, held on the 13th day of BTovember, 1890, all the members being present, a detailed statement of the demand was presented to it, with the request that said board would proceed and audit the same. This the board refused to do, upon the ground that the town was not indebted thereon, or liable to pay the same, or any part thereof. This seems to have been a compliance with requirements of the statute in that regard. If right in the above conclusions, it follows that the plaintiff is entitled to j udgment. The form of the judgment will be settled by me. The attorney for the plaintiff will prepare the necessary findings, and, unless the same are agreed upon by the attorneys for the respective parties, the same will be settled by me on two days’ notice.
*102Hancock, Beach & Devine, for app’lts: Kennedy, Tracy, Mills & Ayling, for resp’t.
On the 13th day of November, 1890, the plaintiff presented a detailed statement of his claim to the board of town audit and requested them to audit and allow his claim; they refused to do so and adjourned sine die. In People v. Wells, 4 Hun, 94, it was suggested that town auditors could not hold special meetings, and that a mandamus requiring them to reconvene and audit a claim was improper, and that it should have required them to audit the claim at the next annual meeting. If plaintiff had waited the assembling of the next annual meeting of the board in November, 1891, he would have been met utith the defense of the statute of limitations; instead thereof he commenced this action on the 10th of March, 1891, while there was no town board in session, and when, under the statutes, none would be in session until the following November. The answer of the defendants contains no allegations that the plaintiff had a remedy by mandamus; nor does the answer contain a defense that the plaintiff has an adequate remedy at law. Town of Mentz v. Cook, 108 N. Y., 504; 13 St. Rep., 845; Ostrander v. Weber, 114 N. Y., 95; 22 St. Rep., 979. Inasmuch as the claim for services of the attorney accrued in April, 1885, the same would have been barred by the six years statute if plaintiff had delayed until November, 1891, for the assembling of the town board; it is difficult to see why the defendants could not avail themselves of all defenses to this action which would have been open for them to present against the proceeding by way of mandamus to compel the board of town audit to consider and allow the claim of the plaintiff. Whether the plaintiff is entitled to an equitable subrogation or not is a legitimate question for the determination of a court of equity. Plaintiff has alleged that he was entitled to such subrogation and the defendants have taken issue thereon, and it has been determined in the trial of the action adverse to the defendants. Under such circumstances, inasmuch as the town board had refused to audit the claim, it is difficult to see why a court of equity has not jurisdiction to ascertain the essential facts relating to the claim and make an adjudication thereon and to direct that the town board proceed to audit the claim. Inasmuch as the town board did not act upon the claim, it may not be said that what took place before the board was an adjudication which was exclusive and formed a bar to any further proceedings on the part of the plaintiff to have his claim established. The People v. Barnes, 114 N. Y., 317; 22 St. Rep., 164; 23 id., 795. If it be assumed that the plaintiff is entitled to recover in either aspect of the case the six years statute of limitations does not stand in his way, as this action was commenced within six years from the 24th of April, 1885, when the services of Mr. Stephens were completed.
In Adams v. Fort Plain Bank, 36 N. Y., 255, it was held that until the determination of an action in which the services of an attorney have been had the statute of limitations does not begin *103to run. It is insisted that the former action based upon the notes held by the plaintiff is a bar to this action. By the opinion delivered in that case, 119 N. Y., 280; 29 St. Rep., 732, it appears that that was an action at law and was tried as such, and it was intimated that under the pleadings in that case the equitable aspects could not be considered, and the essential point discussed in the opinion was, that the town was not liable upon the notes as it had no express authority to borrow money. It was observed incidentally in the opinion that “ The bills for services have never been, audited or allowed in the mode prescribed by the statuteand in that opinion it was said as follows: “ But even if we should assume that it had been sufficiently established that the town had the full benefit of the money thus borrowed, that would not authorize the maintenance of this action. Even if the plaintiff’s testator by the payment of the expenses of the litigation became the equitable assignee of the bills representing such expenses, and mi girt have taken and presented those bills for audit to the board of town auditors, yet he never did so. He did not bring his action upon the theory that he was an equitable assignee of those bills, and he gave no proof which entitled him to recover as an equitable assignee, and the case was not tried upon that theory.” The language just quoted seems to justify an inference that that action was disposed of solely as an action at law, and that the theory upon which the present action is founded was not considered, as it was not supposed to be within the issues then before the court, and thus it is apparent that the present issues were not litigated under the pleadings in that case; therefore, that action is not a bar to the one now presented. Embury v. Conner, 3 Com., 511 ; Palmer v. Hussey, 87 N. Y., 303 ; Belden v. State, 103 id., 1; 3 St. Rep., 8. The language already quoted from the opinion delivered in the court of appeals also seems to furnish a warrant to this court to leave the question as to the plaintiff’s right to the relief awarded to rest upon the principles and authority as presented in the opinion delivered by Kennedy, J., at special term. We therefore forbear any further discussion of the questions presented to us by this appeal. The views already expressed, as well as those contained in the opinion at special term, lead to an affirmance.
Judgment affirmed, with costs.
Merwin and Parker, JJ., concur.