delivered tbe opinion of tbe court:
This is an action to recover tbe amount due for services rendered by tbe plaintiff in tbe transportation of mails, troops, and supplies for and on bebalf of tbe United States from April 1, 1885, to tbe date of filing tbe petition herein, as settled and adjusted by tbe accounting officers of tbe Treasury Department over those portions of plaintiff’s leased and operated lines of road not aided in their construction by bonds of tbe United States, about which services and tbe amount due there is no controversy.
It is averred in tbe petition in substance that tbe plaintiff company is and at all times has been since April 1,1885, a corporation duly organized and existing under special acts of tbe legislature of tbe State of Kentucky, and as sucb since said date has been operating certain railroads in tbe States of California, Nevada, Texas, and tbe Territories of Arizona, Utah, and New Mexico; that on and over tbe railroad lines leased and operated it has rendered services to tbe United States by transporting mails, troops, and other property belonging to and persons in tbe service of tbe United States for which no compensation has been received; that tbe proper accounting officers of tbe Treasury, following tbe decision of tbe Supreme Court} and this court, have settled and adjusted for services rendered in tbe transportation of mails $1,316,972.09; also in transportation for tbe Army $501,087.56, and for miscellaneous accounts to several of tbe Executive Departments $7,439.91, making in all $1,825,499.56; that tbe accounts so settled and adjusted have not been paid because at tbe time of their allowance and since there have been no appropriations out of which under tbe law they could be paid; that tbe plain*102tiff company is the only party owning or interested in the said claim.
The defendants answered the petition by a general traverse. Upon the issues thus formed the defendants contend:
First. That the plaintiff company consists of a partnership of railroad corporations and that the lessor companies constitute a part.
Second. That the leases under which the plaintiff operates its several lines of railroad are ultra vires because made without authority of law.
Third. That the leases are void because the combination of railroads thereunder has the effect to neutralize legitimate competition, and is therefore against public policy.
While, on the other hand, the plaintiff contends that the leases under which it operates its several lines can not be collaterally attacked; further, that as this action is to recover for services rendered, the consideration has passed to the United States, and that therefore the ’ doctrine of ultra vires will not apply. It will be noticed, therefore, that while the defendants do not controvert the fact that such services were rendered on the amount due as settled and adjusted by the accounting officers, still they contend that the plaintiff is not entitled to recover because the leases under which it operates its lines of railroad are ultra vires and against public policy.
Compensation for services rendered over the bond-aided portion of the plaintiff’s leased and operated lines of railroad are not in controversy in this action, for as to the earnings of such bond-aided portions of said roads the plaintiff concedes that the same must be paid into the Treasury as provided by the act of May 7,1878 (20 Stat L., 56), known as the Thurman Act; and in this connection the Supreme Court in the case of the United States v. Central Pacific Railroad Company (118 U. S. R., 241) affirming the decision of this court, said:
“ The construction of the second section of the act of May 7,1878 (the Thurman Act),, is plain and not fairly open to controversy. By the act of July 1, 1862, ‘all compensation for services rendered for the Government’ was to be applied to the payment of the bonds issued by the United States to aid in building the road. By the act of July 2,1864, only ‘one-half of the compensation for services rendered for the Government’ by said company was required to be applied to the payment of the bonds. The act of May 7, 1878,'merely restored the pro*103visions of tbe act of July 1,1862, and again required all compensation for services rendered tbe Government to be applied to tbe payment of tbe bonds. This compensation, as we bave seen, bas been limited by tbe decisions of this court to compensation for services rendered by tbe aided roads. Tbe construction of tbe second section of tbe act of May 7, 1878, contended for by tbe appellee, is, therefore, right.”
If this were an action on tbe leases to recover some consideration thereunder, tbe contention of tbe defendants, in tbe absence of any power on tbe part of said railroad companies to make such leases, would be correct, as was held in tbe case of Central Transportation Company v. Pullman Car Company (139 U. S. R., 24), where tbe doctrine of ultra vires was maintained as between tbe parties to tbe lease contract.
Tbe question as to whether or not an action could bave been maintained, however, even in that case “in tbe nature of quantum meruit, or otherwise,-independently of tbe contract,” was not passed upon because not presented for tbe consideration of the court, nor was tbe question presented in tbe case of Pennsylvania Railroad v. St. Louis, etc., Railroad (118 U. S. B., 316-318, cited by defendants). But in tbe view of tbe case which we take it will be unnecessary to inquire as to tbe extent of tbe powers conferred by tbe respective State and Territorial legislatures in tbe charters granted to the plaintiff and tbe lessor companies or wbat powers were granted to tbe lessor companies by Congress at tbe time bonds and lands were given to aid in tbe construction of certain portions of said roads, or whether or not such powers bave been exceeded by tbe plaintiff and tbe lessor companies in tbe lease contracts between them; for while we concede tbe law with reference to tbe doctrine so ably contended for by tbe counsel for tbe defendants, we deny its application in this case. This is not an action between tbe parties to tbe lease contracts, which tbe defendants contend are unlawful; nor is it to enforce a contract, but is an action by tbe lessee company against tbe defendants — a third party — to recover for services actually performed, where tbe consideration bas passed to and tbe defendants bave received tbe benefit of such services as is conceded. There is no contention that tbe contract between tbe plaintiff and tbe defendants is unlawful, except as such contract grows out of tbe relations existing between tbe plaintiff and its lessors.
*104Tbe principal decision relied upon by counsel for defendants, in support of tbe doctrine for wbicb be contends, is that of Central Transportation Company v. The Pullman Car Company (supra) and tbe authorities there cited. That was an action by tbe lessor against tbe lessee company to recover tbe agreed compensation specified in tbe lease. It will be seen by reference to that case that tbe lessor company was first organized for tbe period of twenty years under tbe general laws of tbe State of Pennsylvania concerning manufacturing companies, etc., “for tbe transportation of passengers in railroad cars constructed aud to be owned by tbe said company in accordance with tbe several letters patent;” by hiring or letting its cars to railroad companies, and requiring its stock, property, and effects to be managed by a board of directors, a majority of whom should be stockholders therein and citizens of Pennsylvania. Some years afterwards, by a special act of tbe legislature of said State, tbe charter of said company was extended to ninety-nine years, with power to double its capital stock and to “enter into contracts with corporations of this or any other State for tbe leasing or hiring and transferring to them, or any of them, of its railway cars and other personal property.”
Forthwith after tbe passage of said special act, tbe corporation thus clothed entered into an indenture with tbe Pullman Oar Company of Illinois, a corporation of that State, engaged in similar business, by wbicb it leased and transferred to that corporation all its cars, railroad patents, and other personal property, moneys, credits, and rights of action, for tbe term of ninety-nine years, except as to patents and contracts expiring before that‘time, and tbe lessor company covenanted in such lease not to “ engage in tbe business of manufacturing, using, or hiring, sleeping cars while tbe indenture remained in force.” For all of this tbe lessee company agreed to pay tbe existing indebtedness of tbe lessor company and to pay to it the sum of $264,000 annually. While tbe validity of tbe lessor’s incorporation, as well as its power to make tbe lease, was held to rest mainly upon tbe special act of tbe legislature, still tbe court in construing tbe words of tbe grant in tbe special act, limited them to tbe words of grant in tbe original articles of incorporation “to do as it bad been doing to ‘lease or hire’ (wbicb are equivalent words) to other corporations in theregu-lar course of its business ” * * * (last paragraph, p. 51), *105The lessor in that case also covenanted in tbe most positive terms never to “ engage in tbe business of manufacturing, using, or biring sleeping cars” while tbe indenture remained in force, thereby covenanting not to do what tbe legislature by such special act empowered it to do, and so tbe court held that tbe lease in that case, as between tbe parties thereto, was ultra vires and against public policy as being in restraint of trade.
Such is not tbe case at bar; for, conceding that in a proper proceeding between tbe parties thereto such leases might be held ultra vires and against public policy, such would not affect tbe right of tbe plaintiff to recover from tbe defendants, a third party, for services actually performed.
Can it be contended that a shipper whose goods were transported by tbe plaintiff over its leased and operated lines of railroad could interpose such a defense in an action to recover tbe freight charges therefor? Certainly tbe plaintiff would not be permitted to set up that tbe lease contracts under which it operates its roads were ultra vires in an action by a third party to recover for services rendered or for money or property passed by virtue of a contract with such third party [McClure v. Manchester, etc., 13 Gray, 129), or to escape liability for negligent or malicious torts (Daniels v. Tearney, 102 U. S. R., 420; National Bank v. Graham, 100 U. S. R., 699).
We understand tbe law to be that “when a government enters into a contract with an individual it deposes, as to tbe matter of tbe contract, its constitutional authority and exchanges tbe character of a legislator for that of a moral agent, with tbe same rights and obligations as an individual.” (3 Hamilton’s Works, 518; United States v. Bank of Metropolis, 15 Pet., 392; Deming v. United States, 1 C. Cls. R., 191.) If there are exceptions to tbe rule just stated they do not apply to this action.
“The doctrine of ultra vires, whether invoked for or against a corporation, is not favored in tbe law, and should never be applied when it will defeat tbe ends of justice if such a result can be avoided.” (San Antonio v. Mehaffey, 96 U. S. R., 315; Railway Co. v. McCarthy, 96 U. S. R., 267; Whitney Arms Co. v. Barlow, 63 N. Y., 62.) In which latter case it was said:
“One who has received from a corporation the full consideration of his engagement to pay money, either in services or *106property, can not avail himself of the objection the contract thus fully performed by the corporation was ultra vires as not within its chartered privileges and powers. It would be contrary to the first principles of equity to allow such a defense- to prevail in an action by the corporation. * * * If the other party has had the full benefit of a contract fully performed by the corporation, he will not be heard to object that the contract and performance were not within the legitimate powers of the corporation.”
Showing that where one has received the benefits accrued from the full performance of a contract by a corporation it would be “contrary to the first principles of equity to allow such a defense to prevail in an action by the corporation.” The defendants are not shown to have been injuriously affected in anyway by reason of such lease contracts, and if the powers conferred on the lessor companies by Congress have been exceeded, the remedy is with the defendants to cause such franchises to be judicially forfeited before contracts with them have been executed.
The late Comstock, Chief Justice, in the cases of Bissell v. Michigan Southern Railroad Company (22 N. Y., 262) and Parish v. Wheeler (22 id., 494), also maintains the same doctrine. In Pierce on Bailroads (Ed. 1881, 516) it is said:
“ The defence of ultra vires is not admitted in the case of executed contracts not involving moral turpitude.
“If the contract is simply not authorized by statute, or is even prohibited by statute, even though no action could be maintained for the breach while the contract remained executory,'an action can be maintained to recover money paid or the price or consideration of property received under it. The doctrine ,of. estoxipel is applied to the defense of want of legal capacity when set up by a party who has received the benefit of the contract, both where the plaintiff alleges such, incapacity in himself or in the defendant.” (Morawetz on Corporations, sec. 689; Field'on Corporations, sec. 264; Wood - on Bailways, sec. 191; Beach on Bailways, sec. 520; Taylor on Corporations, sec. 310; Daniels v. Tearney, 102 U. S. R., 420; Railway Co. v. McCarthy, 96 U. S. R., 267; San Antonio v. Mehaffey, supra; Branch v. Jessup, 106 U. S. R., 468.)
A contract may be ultra vires and still not involve moral turpitude, as was said by the Supreme Court in the case of the Central Transportation Co. v. Pullman Car Co., supra, and Thomas v. Railroad Co. (101 U. S. R., 71). But there is no contention that the contract under which the plaintiff per*107formed tbe services involves moral turpitude or that the character of the services rendered differs in any way from those rendered by other railroad companies, but the contention is that, because the plaintiff entered into lease contracts with its lessor companies, as set forth in the findings, which it is contended are void although no judicial forfeitures are shown, therefore such unlawful contracts can be invoked to defeat a recovery against a third party for services rendered, thus collaterally attacking the lease contracts for the purpose of avoiding payment to the plaintiff for its performance of a contract with the defendants. To permit the defense to defeat a recovery would be to violate the plain rules of good faith, and we are therefore of opinion that the executed transactions between the parties should be allowed to stand, both on authority and principle. We are sustained in this view by numerous authorities.
“In regard to corporations the rule has well been laid down in Parish v. Wheeler (22 N. Y., 494) that the executed dealings of corporations must be allowed to stand for and against both parties when the plainest rules of good faith require it,” Thomas v. United States (101 U. S. R., 86), and such is the law in many of the States, as will be seen by an examination of the following authorities: Dyer & Co. v. Howard (40 Pa. S., 157), Rutland, etc., R. R. Co. v. Proctor (29 Vert., 93), Oil Creek R. R. v. Pa. R. R. (80 Pa., 160), Wilcox v. R. R. Co. (43 Mich., 584), Thompson v. Lambert (44 Iowa, 239), Bradley v. Ballard (55 Ill., 417), Union Water Co. v. Murphy’s Co. (22 Cal., 620), Long v. Georgia P. R. R. Co. (91 Ala., 519).
If such be the rule with reference to executed dealings between parties to a contract ultra vires, or if in such cases relief will be granted, when asked for, independently of such unlawful contract “in the nature of quantum meruit or otherwise,” how much stronger should be the rule as to the contract between the plaintiff and the defendants, a third party. The plaintiff is a corporation by virtue of certain special acts of the legislature of Kentucky, and as such corporation empowered to enter into contracts “with any corporation, company, association, individual, State, Territory, government, or local authority in respect of their bonds, stock, obligations, and securities, or in respect of the construction, establishment, acquisition, owning, equipment, leasing, maintenance, or operation of *108any railroads, telegraphs, or steamship lilies, or any public or private improvements, or any appurtenances thereof, in any State or Territory of the United States,” and by virtue of the powers thus conferred entered into indentures with the lessor companies whereby it leased the several lines of railroad, as set forth in the findings, and operated them in the peri orinan ce of its contract with the defendants. If, therefore, the lease contracts are ultra vires, for want of power to make them, still the contract between the plaintiff and the defendants having been executed, and the defendants, by the general traverse, having admitted the competency of the plaintiff to sue in its corporate capacity (Society for Propagation, etc., v. Town of Pawlet, etc., 4 Pet., 501), and such corporations being pro hae vice the owner of the railroads operated by it would be entitled to recover as against one not a party to such unlawful contract if no moral turpitude were involved. There is no contention that the charters granted to the plaintiff or its lessor companies have been forfeited, as may be done, if violated, by the sovereignties granting them or either of them in a properjudicial proceeding as often held by the Supreme Court. (National Bank v. Matthews, 98 U. S. R., 621-628; Fritz v. Palmer, 132 U. S. R., 282, 291; Reynolds v. Crawfordsville Bank, 112 U. S. R., 413; Railroad, v. Ellerman, 105 U. S. R., 174; Frost v. Frostburg Coal Co., 24 How., 278.)
And this seems to be the law in many if not all the States. (Union Water Co. v. Murphy’s Co., 22 Cal., 621; Bakersfield Town Hall Ass. v. Chester, 55 Cal., 98; Hough v. Cook Co. Land Co., 73 Ill., 23; In re Elevated R. R., 70 N. Y., 327; Grant v. Henry Clay Coal Co., 80 Pa., St., 208.)
So that so long as the governments, National, State, or Territorial, do not cause the charters of such corporations to be revoked courts will treat such corporations, at least as to their executed dealings with third parties, as competent to make such contracts. (Frost v. Frostburg Coal Co., 24 How., 284; Angel & Ames, sec. 774 and cases there referred to.)
Counsel for the defendants in his brief in reply contends that the lessor companies are entitled to the compensation for the services rendered by the plaintiff for the reason that the leases being null and void, said lessor companies stand in the same relation to the defendants that they would have had such leases never been made, and that the accounting *109officers of the Treasury having' settled and adjusted a portion of tbe accounts for such .services to the credit of the lessor companies, as shown in the findings, therefore such lessor companies are entitled to the compensation therefor, although said companies are not claiming the same, nor are they claiming to have any contract with the defendants.
It is also true, as stated by defendants’ counsel, that since July, 1890, the accounting officers of the Treasury have settled and adjusted accounts for like services rendered by the piantiff over its nonbond-aided portions of road, to the credit of and paid to the plaintiff, while the services rendered by it over the bond-aided portions of the Central Pacific Eailroadhavebeen adjusted to. the credit of said company under the provisions of the Thurman act supra. But we attach no importance to the action of the accounting officers in this respect, for the reason that the manner in which they adjust accounts to the credit of one company would not bind or affect the rights of another which had performed the services. If, however, the contention of the defendants be true, that such leases are null and void, and that the relations of the lessor companies to the defendants are the same as if no lease had been made, then the question arises whether or not such services were not performed under a contract arising in law, and that being so, and such lessor companies not claiming pay for such services, and such services having been actually performed by the plaintiff, and its competency to sue in its corporate capacity being admitted by the general traverse, can it not recover in this action under the allegations of the petition on quantum meruit; but in the view of the case we have taken it is unnecessary to pass upon this question.
We see nothing in the leases to justify the defendants’ contention that the plaintiff and its lessor companies consist of a partnership of railroad corporations, and, so far as the findings show, the relations existing between them rest on the leases alone, and in the absence of fraud, which could not be set up by a third party, no evidence is admissible to vary the terms thereof.
This course seems to us not only in line with the authorities, but as founded on the rules of good faith between the parties, for otherwise the defendants, not shown to have been injuriously affected by such lease contracts, even if ultra vires, would *110be getting tbe services of tbe plaintiff without compensation, and that is against the policy of tbe law, if not in violation of tbe Constitution itself.
For the reasons given we are of tbe opinion that tbe plaintiff is entitled to recover tbe amount found due as stated in tbe findings, and judgment will, therefore, be awarded for tbe sum of $1,824,336.44.
Nott, J., did not sit in tbe trial of this case and took no part in tbe decision.