
    THE WESTERN MARYLAND RAILROAD COMPANY vs. THE BLUE RIDGE HOTEL COMPANY.
    
      Corporations — Ultra Vires Contract — Guaranty by Railroad Company of Indebtedness of a Hotel Company — Part Performance of Void Contract — Estoppel.
    A contract by which a railway company, not empowered by its charter so to do, guarantees the payment of interest and dividends on the bonds and stock of a hotel company on the line of its road, is ultra vires and void; and it-makes no difference that the payment is called commissions on traffic receipts from and to certain stations.
    The fact that the hotel company expended money in the erection of its building upon the faith of such a guaranty does not estop the railway company to set up the defense that the contract is void.
    When a corporation has received money or property under an executory contract which is ultra vires, an action by the other party to the contract lies against the corporation to recover the money or property so received. In such case the action is not on the contract but to enforce ■ the obligation of the corporation to restore that which it obtained by its illegal action and to which it has no just title.
    A railroad company chartered to construct and operate a railroad, and authorized in addition to aid other companies in the construction of railroads, made a contract with a hotel company by which, in consideration of. the erection or enlargement of a summer hotel at a point on the line of the road, it was agreed that if, in any one year, the net earnings of the hotel company shall not suffice to pay a five per cent dividend on its capital stock, and interest on its first mortgage bonds, then the railroad company would pay to the hotel company for its stock and bondholders such commissions upon its. receipts from traffic to and from two stations near the hotel as will be sufficient to make up the deficit. For some years the railway company made good the insufficiency of the earnings of the hotel to pay the stipulated dividends and interest; and upon its refusal to make further payments for this purpose this action was brought on the contract to recover the amount of one year’s deficit. Held, that under the contract the full amount of the gross receipts from traffic from the stations, named was pledged as an absolute guaranty to the holders of the stock and bonds of the hotel company; and the agreement is not a contract for commissions on, or a rebate from, the gross receipts of these stations.
    Held, further, that this contract is ultra vires and void because the rail way company has no power under its charter to guarantee the payment of interest and dividends by a hotel company, and consequently no action lies against the railroad company on the contract.
    Held, further, that the performance of the contract by the hotel company in the erection of its building does not estop the railway company to set up the defense of ultra vires, since it has not received any money from the hotel company under the contract and is not withholding money received under a void contract.
    Appeal from the Baltimore City Court (Stockbridge, j.)
    The cause was argued before McSherry, C. J., Briscoe, Boyd, Pearce, Schmucker, Jones and Burke, JJ.
    
      
      Benjamin A. Richmond, and Leon E. Grcenbaum (with whom was George R. Gaither on the brief), for the appellant.
    The covenant on the part of the railroad company, on which suit is brought, whatever its technical name may be, is plainly an attempt upon its part to extend its financial aid and credit to the hotel company, and guarantee the financial success of that enterprise to a certain extent through an indefinite period of time. It is an undertaking by which, in certain events, the railroad company agreed to assume and pay the debts and obligations of the hotel company. Interest on bonds of the hotel company and dividends on stock are in' no sense obligations or debts of the railroad company, but were obligations of the hotel company and of that company alone in the first instance. Such a contract has unquestionably many, if not all of the features of a guaranty, as such term is ordinarily used. Davis v. Old Colony R. Co., 131 Mass. 258; Elevator Co. v. R. R. Co., 85 Tenn. 703.
    It was a contract made for the benefit of the stockholders and bondholders of the hotel company, rather than for the benefit of the hotel company itself, since, if the railroad company had paid the hotel company anything under this contract, the stockholders and bondholders could have unquestionably recovered the amount so paid. Whether this duty and obligation were guaranteed by the railroad company directly to the hotel company or to its stockholders and bondholders, makes no difference.
    It seems to us equally clear that the fact that the contract provides that the guaranty shall be made good by the railroad company out of its receipts from Blue Mountain and Pen Mar stations by way of “commissions” from such receipts, is equally immaterial. The use of the word “commissions” here is a mere play upon words to conceal in some measure, the plain and obvious nature of the obligation. The deficit of the hotel company in dividends and interest was not to be made up by a percentage of the receipts from these stations by way of commissions at all. The whole gross recepts from these two stations of the railroad company were devoted in 
      solido to the liquidation of this deficit. If it required the last penny of these gross receipts to make good this deficit, they were pledged by this contract to this purpose. It was idle, therefore, and trifling with the facts, to call these payments, so to be made, “commissions” on traffic receipts. The word “commissions” generally carries the idea of certain percentage, but the use of it in this contract in no way changes, conceals or weakens the obligation of the guaranty.
    The doctrine of some few early decisions in two or three of the States, that corporations have all powers except those expressly prohibited by their charters, has never been sanctioned by the Courts of Maryland. Steam Navigation Company v. Dandridge, 8 G. & J. 319; Weckler v. Bank, 42 Md. 561.
    It is an equally well-settled principle of law that the power is ordinarily not possessed by a corporation to directly or indirectly jeopardize its own existence by pledging its funds in behalf of corporations chartered for other purposes. Savage Co. v. Worthington, 1 Gill, 284.
    It is also clear that a railroad company is no exception to the general rule. Indeed, on the contrary, the fact that a corporation is a public service corporation makes the rule peculiarly applicable to it. Mayor and City Council of Baltimore City v. B. & O. R. R. Co., 21 Md. 50; State v. Consol. Coal Co., 46 Md. 1:
    The proof shows that the hotel was situated six hundred feet from the nearest railroad station, and more than half a mile from the Pen Mar Station — too far, to afford passengers travelling on the trains an opportunity to stop and get their meals there. It was a summer hotel, pure and simple, and opened in June and run until October, and not a railroad hotel, like the Queen City, in Cumberland, or hotels that are maintained on large trans-continental lines, to supply meals to passengers. As a hotel, therefore, it was utterly useless to the railroad company or to its passengers. It was too far from the railroad for trains to stop there and give passengers their meals. Besides, it was only open from June to October, and therefore, could not in the remotest sense be any necessary part of the equipment of the railroad. It was a mere summer hotel for the accommodation of permanent guests. Any advantage, therefore, to the railroad company from that hotel was merely incidental, the same as a town on its line, or a farm on its line, or a manufactory on its line, or any other place on its line, which might attract passengers over its road. The difference between such a hotel and a railroad hotel is illustrated in State v. B. & O., 48 Md. 49; Ry. Co. v. Crawford Co., 29 Wis. 116; R. Co. v. Milwaukee, 34 Wis. 283.
    If it is said that the building and operation of the hotel has incidentally improved its passenger or freight receipts — which is the justification for it made by the lower Court in its opinion — this is no more than could be said of every other business and industry along the road. The same right to guarantee0the stock or bonds of a flour mill, of a stock farm, a lime kiln, a marble quarry or a mine, or any other industry which might prospectively increase the earnings of the company from freight and passengers, could be claimed under the same pretense, and thus, by setting up such an implied power in the case of a hotel, we might set up the same power as to every industry along the railroad, from end to end, and the result would be that the capital of the stockholders, placed in the hands of a public service company for the purpose of building and running a railroad, could be diverted, to every purpose but the running of a railroad, and the public policy of the State, which required the railroad company to confine its operations to the building and running of a railaoad for the accommodation of the public, would be utterly frustrated, and these powers, intended exclusively by the State for railroad purposes, devoted to and wasted in a thousand other speculative schemes, which might or might not result in benefit to the company, but would certainly disable it from entirely carrying out its charter powers in the running of its railroad. It is too well settled for argument that the charter of a public service corporation not only confers on it rights but imposes duties, and that all schemes are void which must or may result in an abandonment of these duties.
    
      The case at bar is not the only case in which this usurpation of power under the fancied pretense of obtaining collateral and speculative benefits has been attempted by railroad companies. In each and every case, however, the Courts, upon the application of injured parties, or even the corporation itself, have universally stricken down these speculative, void and illegal contracts. Elliott on Railroads, sec. 374 and cases cited; Louisville R. Co. v. Trust Co., 174 U. S. 567.
    A corporation not specially authorized so to do (such as a guarantee company) has no power whatever to become a guaranty or surety for or lend its credit to any other person or corporation, or pledge its funds for purposes for which it was not chartered. Morawetz on Corporations, sec. 423; Green's Brice's Ultra Vires, p. 252; 7 A. & ,E. Ency. of Law 2 ed., 788-790; Ward v. Joslyn, 186 U. S. 142; Penn. R. Co. v. St. L. R. Co., 118 U. S. 290; Bowen v. Needles Nat. Bank, 94 Fed. Rep. 928; Humbolt Min. Co. v. Am. Mfg. Co., 62 Fed. Rep. 356; Nat. Bank v. Germ. Am. Sec. Co., 116 N. Y. 292; Aetna Bank v. Charter Oak Ins. Co., 50 Conn. 167; Rogers v. Jewel Belting Co., 184 Ill. 574; Berry v. Yates, 24 Barb. 199; Madison v. Plank R. Co., 7 Wis. 59; Smith v. Ala. Ins. Co., 4 Ala. 558; Johannsen v. Chaplin, 6 Montreal (Q. B.) 111.
    Outside of Katz's case, 57 Md. 126, it would seem that no recovery at law in Maryland has ever been allowed in a suit directly upon the void contract, and was only allowed in Katz’s case in order to subserve the plainest and most obvious principles of equity and justice. We think, therefore, it can be claimed by us, that on this question ofiestoppel the decisions in Maryland, taken as a whole, are fairly within the lines laid down by the Supreme Court of the United States, in England, and a large majority of the State Courts; and that even under the Katz’s case the position of the appellant is correct, inasmuch as the suit here is upon a contract which has not been wholly executed by either party, but is still in process of execution by both parties, and is brought to enforce the unexecuted pait of this contract, and is not based upon any idea of money or property which has passed from the plaintiff to the defendant.
    
      What consideration or benefits can be said to have, been parted zvith by the hotel company, or them, and received by the railroad company, and what detriment or injury will be done to the hotel company, or its security holders, by the abrogation of this contract (even if such detriment can be considered on the question of estoppel, which we think it cannot, under the decisions in Maryland above stated), which would raise up an equity in its favor, sufficient to escape the well-settled principle of law? What money, property or thing has passed from the hands of the hotel company or its security holders into the hands of the railroad company, which it still retains contrary to equity and good conscience? Not a dollar, not a cent. The hotel company, its stockholders and bondholders have pai-ted zvith nothing which the railroad company has received. The hotel company spent its own money for its own property, which it still has, and if it expended this money judiciously it still has its money worth in property, for every dollar it has spent.
    The payment of the fares did not come out of the pocket of the hotel company, and was not a detriment to the extent of a single cent. The hotel company lost nothing by the payment of these fares. They merely came to the railroad company incidentally, from strangers, as a part of its business. The principle of estoppel can-never be applied in favor of one who has lost nothing, even though the other party may have obtained something from a stranger; and we submit that in no case in Maryland and no case outside of Maryland, not even in the least respectable Court in the United States, has it ever been sanctioned that the plea of ultra vires could be avoided on the principle of equitable estoppel, in favor of one who had parted with nothing, and lost nothing, but still had in its hands everything that it started with.
    In Dandridge's case, supra, Dandridge was riot allowed to recover on the contract damages growing out of the contract, even though he had suffered severely through no fault of his by the breach of the contract on the part of the steamboat company. In Weckler's case, sztpra, ’Mrs. Weckler was not allowed to treat the ultra vires contract as a security for her losses, even though her losses were severe. The same thing can be said of Lazear's case, 52 Md. 78. It is only in such cases in Maryland as Forman's case, 29 Md.; Katz's case, 57 Mel., and Sweeney s case, 83 Md., that the doctrine of estoppel was allowed, not in favor of damages or profits predicated on the contract, but in order to do justice between the parties, and make one of them, who had obtained the whole substantail fruits of the transaction, under an executed contract, refund that which in equity and good conscience he had no right to retain.
    Where the parties have so far acted upon such a contract, that they cannot be restored to their original condition, and property has passed, the Court inquires whether any relief can be given independently of the contract, or whether it will refuse to interfere as the matter stands. As illustrations of this rule in the Supreme Court in various cases where long acquiescence, part performance or changed situations were sought to sustain the doctrine of estoppel, but unsuccessfully, all of which cases were founded upon a better equity than the case of the appellee, see Pa. R. Co. v. St. L., &c., R. Co., 118 U. S. 290; Pittsburg & L. E. Ry. Co. v. Keokuk Bridge Co., 131 U. S. 371; St. L. & C. Co. v. Terre Haute Co., 145 U. S. 393; Jacksonville R. Co. v. Hooper, 160 U. S. 514; U. P. R. Co. v. Chic. & C. R. Co., 163 U. S. 564; Ward v. Joslyn, 186 U. S. 142.
    The English cases are all the same way. East Anglian Ry. Co. v. Eastern Co.'s Ry., 11 C. B. 803; Munt v. Shrewsbury Ry. Co., 13 Beav. 1; Ashbury R. Co. v. Riche, L. R. 7 H. L. 653. And the following cases from the State Courts: Simmons v. Troy Iron Works, 92 Ala. 427; Day v. Spiral Springs Co., 57 Mich. 150; Nat. Association v. Home Bank, 181 Ill. 35; Franklin Co. v. Lewiston Inst., 68 Me. 43; Malloy v. Honneher Oil Works, 86 Tenn. 598; Davis v. Old Colony Co., 131 Mass. 258; Farmers' Bank v. Baldwin, 23 Minn 198; Downing v. Mt. Wash. R. Co., 40 N. H. 230; Anthony v. Sewing Machine Co., 16 R. I. 571; Memphis El. Co. v. Memphis R. C., 85 Tenn. 703.
    
      In short, the rule that an ultra vires contract, even though there has been long acquiesence and changed situation as to property, and part performance, can have no such vitality imparted to it by the principle of estoppel as to sustain an action at law by one of the parties to the void contract, in a suit directly upon the contract, is affirmed by so many cases in England and America, in all Courts, that it would serve no useful purpose to cite them. A list of them covering two pages will be found set out on pages 54 and 55 of 29 A. & E. Encyclopedia of Law, 2 ed. But while affirming this rule, they nearly all of them, in cases of manifest equity, arising from the transfer of property or the transfer of money, and the like, permit these equities to be asserted and worked out in other forms of procedure, such as actions for money had and received, or for use and occupation, or by bills in equity for an accounting. These equities, however, all grow out of money demands or rights which accrue from the situation in which the property had been placed, and not by way of damages or money demands which accrue alone from the terms of the illegal contract.
    
    Summing up the argument on this point, we contend that the doctrine of estoppel is not a bar to the plea of ultra vires in this case, because, firstly, we are dealing with a suit at law, brought on the contract and not in repudiation of it i secondly, because it is brought on the executory.portion of the contract and has no reference to the executed portion thereof; thirdly, because it is not based upon money or property received by the defendant from the plaintiff, which ought to be returned; fourthly, because of the inequities of the contract itself.
    
      William S. Thomas (with whom were N. Winslow Williams, Henry W. Williams and Edward G. Gibson on the brief), for the appellee.
    The testimony shows that the bonds and capital stock in the hotel company were sold at par and the money collected and all of it used in building and furnishing the hotel now operated, and in paying for the land, and this was done under the supervision and direction of the president of the railroad company. That the railroad company took possession as sooq as the contract was signed and have held since uninterrupted possession of the roads and branches belonging to the hotel company for the use of its excursionists to Pen Mar and have possession also of Mount Quirauk which is thus described by a witness : “There is an observation station there which is quite attractive to excursionists. It is right at the top of the mountain, South Mountain, and á great many people visit there. It is a beautiful drive. It goes up through the property of the Blue Ridge Hotel Company and you can look right over the entire country.' In fact you can see portions of four States, Pennsylvania, Maryland, Old Virginia and West Virginia, and the country generally, you look down on the valley.” The testimony further shows that the erection of the hotel put life into that section of the road and caused other cottages and hotels to be built in the vicinity. There are outstanding bonds of the hotel company to the amount of one hundred and twenty-two thousand dollars, three thousand dollars of bonds having been retired and cancelled under the mortgage and at the close of its season in October, 1903, the actual net earnings of the said hotel company, from the hotel and other sources is not sufficient to pay the dividend of five per cent on its stock and to pay the coupons on its first mortgage bonds amounting in the aggregate to $8,660, and it has no-money to pay these sums, for which suit is brought. The railroad company earned in its traffic to and from Blue Mountain and Pen Mar Stations for the year 1903, the sum of $49,074.48.
    It is a general rule that a corporation in addition to the powers expressly granted has by necessary implication the power to do whatever is needed to carry into effect those granted to accomplish the purposes of its creation, unless the particular act is prevented by the law or its charter. These implied powers which a corporation has in order to carry into effect its legitimate purposes are not limited to such as are indispensable to their accomplishment, but comprises all those powers that are necessary, in the sense of appropriate, convenient and suitable, including a right of reasonable choice of means to be employed, and whether an act comes within those powers must be determined in each case from its facts and circumstances.
    The charter of the appellant confers unlimited powers to build and operate its road and to make all contracts necessary to that end. It is of prime necessity in successfully operating a railroad for it to obtain traffic.
    The contract in suit is a traffic agreement. It is not an absolute guarantee of the bonds and stock of the appellee; it is an agreement to pay a commission in the shape of a rebate on the amount of traffic that is attracted to a point on its line by an improvement placed there in consideration of the agreement. If there is no traffic attracted, then there is no liability. A railroad company can and does employ solicitors of traffic and pays them a salary or commission based on the amount of traffic brought to the road; it advertises in the newspapers its train service and the superiority and advantages of traveling by its road; it grants free passes to those whom its management considers render service to the road. These expenses and charges are paid in cash out of its traffic receipts and in other ways, and these acts have never been held ultra vires. Elliott on Railroads, vol. I, sec. 41, 42, 1611; Western Maryland R. R. Co. v. Lynch, 82 Md. 233; Metropolitan Asso. v. Scrimgeour, 73 L. T. Rep. 137.
    The contract in this suit is an undertaking on behalf of the hotel company to erect on the line of the railroad company a structure which cost two hundred and twenty-five thousand dollars; a structure which will advertise the road and attract traffic to its lines and an agreement that if the hotel company requires it, the railroad company will pay a commission to the hotel company, out of the returns from the traffic attracted to its lines. Such a contract is not against public policy. Hoover v. Penn. R. R. Co., 156 Pa. St. 220, 245.
    In Stewart v. Lehigh Valley R. R., 38 N. J. L. 505, a covenant in a lease by a canal company to allow drawbacks in consideration of the establishing of a freight service is valid although made to a director of the canal company because not avoided within a reasonable time.
    In Root v. Long Island Ry. Co., 114 N. Y. 300, the defendant railroad company, and one Root entered into a contract which provided that the latter should build upon certain lands belonging to the former, a dock and place for storing coal. Defendant to use the south side of dock and right to use other portions. Defendant agreed to transport in its cars all the coal in car loads offered for transportation for ten years at a rebate of fifteen cents per ton. At the termination of the contract the dock and structure were to be appraised and the value, less $2,000, advanced by the defendant, paid by Root. This was an action to recover the rebate agreed upon. Defendant claimed that the contract was void as against public policy. Held there was nothing contrary to public policy in the contract and the contract was legal.
    There can be no distinction in reason between the case at bar and the contract of one railroad company with another, for a division of traffic receipts for traffic brought to one railroad by the other carrier. Traffic agreements of this kind are universally upheld under the implied powers of corporations. Union Pacific Ry. Co. v. Chicago & Erie Ry. Co., 163 U. S. 585; Sussex R. Co. v. Morris & Essex R. Co., 19 N. J. Eq. 13; Attorney-General v. Great Eastern R. C., L. R. 11, Ch. D. 478; L. R. 5 App. Cases 473; Green Bay R. Co v. Union Co., 107 U. S. 98.
    In analogy to the contract at bar are contracts for rebates, which are upheld when the prices charged to others are reasonable because of benefit to the railroad in attracting traffic. Interstate Commerce Commission v. B. & O. R. R., 145 U. S. 263; Cook on Corporations &c., sec. 901 and cases cited; Hoover v. Pennsylvania R. R. Co., 156 Pa. St. 220; Baylis v. Kan. Pac. R. Co., 13 Col. 181. In Cleveland C. C. & I. R. Co. v. Closser, 126 Ind. 350, a contract was entered into between the Ry. Co., and Closser, who was engaged in the grain business, whereby the railway agreed to transport grain for said firm between certain points at a certain price, twenty-one cents per hundred weight, it being agreed that Closser & Co. should be entitled to a rebate of four and one-half cents per hundred weight. The railway refused to refund part of the money paid to it as freight, so Closser brought suit, The Court held that this contract was valid and enforceable. Also that a contract giving a special rate to a shipper and providing for a drawback is not in itself illegal and void. To have this effect there must be some unjust and oppressive discrimination. To the same effect see MacNees Res. v. Mo. Pac. Ry. Co., 22 Mo. App. 224; Cowden v. Steamship Co., 94 Cal. 470; Johnson v. Pensacola Ry. Co., 16 Fla. 623, 659; Ex parte Benson & Co., 18 S. C. 38; Anderson v. Midland Ry., 71 Law Journal, Ch. Div. 89; Ragan & Buffet v. Aiken, 77 Tenn, (9 Lea.) 609, 621; Borda v. Phil. R. R. Co., 141 Pa. St. 484. In U. S. v. Hanley; U. S. v. Morris; U. S. v, Thompson; U. S. v. Jenkins, 71. Fed. Rep. 672, under section 2 of the Interstate Commerce Act, which makes it unlawful for carriers to receive greater or less compensation from one shipper than from another, for whom the carrier renders like service an indictment which states that a carrier gave a rebate to one shipper without stating any instance in which the carrier refused a like rebate to any other shipper is defective, as not showing discrimination. In this case Hanley et al. as officers of the railroad, were indicted for giving rebates. The defendants moved to quash the indictments. The indictments were quashed.
    The appellant had authority under its charter to make special contracts for traffic; a rebate is in fact a contract for a special rate and the contract therefore was authorized under that power. Marsh v. Chicago R. I. & Pac. Ry. Co., 79 Iowa, 333.
    In Jacksonville, &c., Ry. Co. v. Hooper, 160 U. S. 514, the Supreme Court of the United States held where no legislative prohibition is shown, it is within the chartered powers of a railroad company to lease and maintain a summer hotel at its seaside terminus.
    
      The appellant contends that as it was held in the case of Davis v. Old Colony R. R. Co., 131 Mass. 258-275, that a railroad corporation which has actually received nothing cannot guarantee profits on an agricultural fair association ; the contract at bar is ultra vires. Apart from the fact that the contract in that case was entirely different from the one at bar and that the railroad company in this case is actually receiving nearly fifty thousand dollars a year through the hotel, we refer the Court to the criticism of the above case in Baldzvin on American Ry. Law (1904), p. 38, in which the author says: “It is believed that the judgment in that case is unsound.”
    In Richelieu Hotel Co. v. International Military Encampment, 140 Ills. 248, it was held to be within the power of a corporation organized to conduct a hotel business, to subscribe to a fund to establish a military encampment likely to attract strangers requiring hotel accommodations. See also Brice on Ultra Vires (3rd ed.), 149-151; Wheeler, Osgood & Co. v. Everett Lumber Co., 14 Wash. 630; Fuld v. Barr Brewing Co., 18 N. Y. Supp. 456; Standard Brew Co. v. Kelly, 66 Ill.App. 267 ; Winterfield v. Cream City Brew Co., 71 N. W. Rep. 101.
    The appellant while enjoying the fruits of the contract, and the contract being executed on the part of the appellee, and its bondholders and stockholders being bona fide holders for value without notice, is estopped from raising the question of ultra vires.
    
    
      ■ There is a uniformity in decisions that either party to an ultra vires contract while retaining the benefits is estopped to plead the contract was ultra vires in order to defeat recovery, but .they are not agreed as to the remedy in such case. The weight of authority, including this State, is that suit can be brought on the contract. German Bank v. Katz, 57 Md. 128; German Aged Home v. Hammerbacker, 64 Md. 606; Heirionimus v. Sweeney, 83 Md. 160, Harrison & Brown, trustees, v. Annapolis & Elkridge R. R. Co., 50 Md. 514; Shelby et al. v. C. & E. & I. R. R. Co., 143 Ill. 385; State Board of Agricultural v. Citizens St. Ry. Co. 47 Ind. 407; Beach on Pri
      
      vate Corporations, secs. 423—425-433; Elliott on Private Corporations, sec. 218; Tennessee Ice Co. v. Raine, 107 Tenn. 158; Dayton & U. Ry. Co. v. Pittsburg Ry. Co., 25 Ohio Cir. Ct. R. 705.
   Pearce, J.,

delivered the opinion of the Court.

This is an action of covenant brought by the Blue Ridge Hotel Company of Washington County, a corporation organized under the general incorporation laws of Maryland, against the Western Maryland Railroad Company, a corporation created by an Act of the General Assembly of Maryland, ch. 304 of 1852, under the name of “The Baltimore, Carroll, and Frederick Railroad Company,” the name being changed by ch. 37 of 1853 to “The Western Maryland Railroad Company.” The covenant sued upon is contained in a sealed agreement between the parties, made October 23rd, 1883. This agreement recites the making of a previous agreement between the parties on April 2nd, 1883, whereby the said railroad company, in consideration of anticipated advantages to it from the construction by the said hotel company of a summer hotel near Pen Mar Station on the line of said railroad, had agreed to secure the payment of a dividend not exceeding five per centum per annum on the capital stock of said hotel company of one hundred thousand dollars. The agreement sued on then further set forth that since the erection of said hotel, the railroad company had in fact derived large receipts from travel and traffic to and from the station used for said hotel, known as the Blue Mountain Station, and that its receipts from travel and traffic to and from an adjoining station, known as Pen Mar Station, had, by reason of the attractions of said hotel and its neighboring property, increased to an amount exceeding the utmost liability to be assumed by it, under the contact then made, and that it was believed these receipts would be largely augmented by increasing the capacity of the hotel, and by the improvement of the grounds of the hotel company, and of its other property near Pen Mar Station; that the hotel .company had already expended in the undertaking more than its whole capital, and an additional amount, not less than $125,000, was necessary to complete improvements begun, and others contemplated, which could not be procured without the assistance to the credit-of the hotel company as thereafter stipulated in said agreement; that the hotel company was about to issue its bonds to an amount not exceeding $125,000, bearing interest at the rate of six per cent per annum and to be secured by a first mortgage upon the said hotel and its revenues, and such other of its property as should be described in said mortgage. The agreement then further set forth that in consideratidn of the advantages expected to accrue to the railroad company from the said improvements to the hotel and its other property, and of certain privileges secured to the railroad company by the terms of said agreement for the benefit of its excursionists, the said railroad company covenanted with the said hotel company, as follows: “That if in any one year the actual net earnings of said hotel company from said hotel and other sources shall not suffice to pay five per cent dividend upon its capital stock of $100,000, and the interest at the rate of six per cent, semi-annually, upon such amount of said first mortgage bonds as may be issued for the purposes herein stated, not exceeding $125,000, the said railroad company will, in that event, allow and pay to said hotel company for its stockholders, and the holders of said bonds, such commissions upon its receipts from traffic to and from Blue Mountain and Pen Mar Stations, or any other station or stations which may be hereafter substituted for either, or both, of the above, at which the business hereby contemplated may be done, as will be sufficient to, make up said deficit to five per cent upon its capital stock, and six per cent per annum upon its bonded debt;’ ’ and the hotel company upon its part entered into a covenant designed to protect the railroad company in the proper application of the revenues of the hotel company to its economical and successful management, and of the net earnings to the dividends and interest due to its stockholders and bondholders. The declaration averred that in reliance upon this covenant of the railroad company, it issued its bonds to the amount of $125,000, of which $122,000 were still outstanding, which sum was expended in the improvements contemplated by the agreement, and that at the close of the fiscal year of the hotel company ending October 1st, 1903, the net earnings of the hotel company were not sufficient to pay the nterest then due on said bonds, by the sum of $3,660, and xt he re was nothing available for payment of the $5,000 dividend then due to its stockholders; that demand had been duly made on defendant for said sums, and that payment had been refused.

It will only be necessary to consider the defendants’ fourth plea which averred that the agreement sued on was ultra vires on the part of the railroad company, and void, and could not be enforced by suit su'ch as was brought against it. To this plea the plaintiff demurred, and the demurrer being sustained, the case went to trial on issues joined on the other pleadings, resulting in a verdict for the plaintiff for $9,433.68, and judgment thereon. The defendant offered six prayers of which the first and second raised the same question raised by the demurrer, and were refused by the Court, no prayers being offered by the plaintiff.

The question raised by the demurrer, and by the defendant’s first and second prayers, is the vital question in the case, and will now be considered.

The agreement was drawn with much care and skill, and evidently with a view to the avoidance of the question raised, as is suggested by the phraseology of the covenant "to alloiv and pay such commissions upon its receipts to and from” the stations named as would make good the deficit which was the subject of the covenant, but we do not think the use of this language can disguise the real character of the transaction, or control the validity of the obligation assumed by the railroad company. If the contract would be declared ultra vires if the deficit were to be made good from the general receipts of the company, it could not be rescued from invalidity, by calling the payment to be made, commissions from traffic receipts from the particular stations named. There is no limit to the rate of commission to be paid. The full amount of the gross receipts from these two stations was pledged by that covenant if required to make good this deficit. This appears not only from the language of the covenant, but even more explicitly from the recital of the mortgage from the hotel company to the trustees of its bondholders, which assigns to said trustees “the benefit of the contract between the hotel company and the railroad company, dated October 23rd, 1883, by which the payment of the interest on the said bonds is guaranteed by the said railroad company to be paid of the receipts from the traffic at Blue Mountain and Pen Mar Stations.” , A contract which in effect pledges the total gross receipts from any source, cannot be regarded as a contract for commissions on, or, a rebate from, those gross receipts, and this contract must | be regarded as an absolute guaranty to the stockholders and bondholders of the hotel company of their dividends and interest", tp the extent to which the receipts from the stations named should be adequate for that purpose, since in the language of the contract, the payment was to be made “to the hotel company for its stockholders and bondholders.” The promise thus made was a promise “to answer for the payment of some debt, or the performance of some duty, in case of the failure of another, who is himself, in the first instance, liable to such payment or performance.” 14 Am. & Eng. Ency. of Law, 1128, 2 ed. Its object, as declared in the recitals of the agreement was to furnish to the hotel company “assistance to its credit,” and it was at least twice designated in said agreement as a “traffic guarantee,” and we think it could not be accurately otherwise designated. It is therefore necessarily a collateral contract, but there is no question here of the Statute of Frauds, and it would make no difference so far as its validity is here concerned, if it- had been an original contract to pay the hotel company a lump sum upon the consideration stated. The question of idtra vires would still remain for consideration.

, Corporations, being mere creatures of law, possess only , such powers as are expressly granted, together with, such incidental and implied powers as are necessary to carry into effect those expressly granted. “An incidental power is one that is directly and immediately appropriate to the execution of the specific power granted, and not one that has only a slight or remote relation to it. * * * It can in no case avail to enlarge the express powers, and thereby warrant the corporation to devote its efforts or its capital to other purposes than such as its charter expressly authorizes, or to engage in collateral enterprises, not directly, but only remotely connected with its specific corporate purposes.” io Cyc., 1097-1098. And it is equally well-settled that “a corporation has no power' to enter into a contract of suretyship ox guarantee, or otherwise lend its credit to another, unless the power is expressly conferred by its charter, or unless such a contract is reasonably necessary, or usual in the conduct of its business.” 7 Am. & Eng. Ency. of Law, 188, 2 ed.

The original charter powers of the Western Maryland Railroad Company are found in secs. 14, 15 and 18 of ch. 304 of the Acts of 1852. In addition to the mere power to construct a railroad from Baltimore to Westminster, and thence to some point on the Monocacy river in the direction of Hagerstown, the additional powers given are to erect warehouses or other works necessary to said road, and to contract with the Susquehannah Railroad for intersecting its road; to carry the mail and to bor- - row money no.t exceeding $200,000.

Chap. 71 of 1872 gave the power to construct a railroad from the western end of the tunnel of the Balt. & Potomac R. R. to Williamsport or to Cumberland together with all buildings, stations, other works and accommodations necessary or convenient for the operation of said road, and to execute mortgages upon its property for building the road. Sec. 8 of that Act, which is specially referred to by the Court below in the ruling upon the demurrer, set out in the record, gives power to aid any other company in the construction of its railroad, by means of subscription to its capital stock, or otherwise, for forming a connection therewith, and to consolidate with any other corporation owning a railroad, or a railroad and any other property; and chap. 153 of 1884 gives the only power of. guaranty it possesses, and limits this power to the obligations of other railroad companies.

In none of these Acts do we find any power, express or implied, either to engage directly in the construction and operation of a summer hotel, or to lend its credit to any other corporation engaged therein, while the Acts of 1872 and 1884, supra, seem to us, by their express limitation of the powers granted to dealing with railroad companies, or companies “.Owning a railroad and other property,” to exclude the power to engage in any other business than that of a railroad, or to guarantee the obligations of any other corporation than a railroad corporation. However the strict rules which we have cited above may have been relaxed or evaded elsewhere under the influence of competition in trade and commerce and of the modern theories of expansion of power in every direction, they are still approved by text writers of the highest authority and have been always observed and enforced by the Court in this State.

Judge Seymour D. Thompson, in 10 Cyc. 1146, says:

“Perhaps the most general statement which can be made of the doctrine of ultra vires, is to say that the contract of a corporation which is unauthorized by or in violation of its charter, or other governing statute, or entirely outside the scope of the purposes of its creation, is void, in the sense of being no contract at all, because of a total want of power to enter into it. ” And Mr. France in his recent excellent work on the Elements of Corporation of Law, sec. 72, says: “The transaction may be beyond the powers of the corporation, simply because it is foreign to the purposes expressed or implied in the charter; it may invoke the exercise of a power, not forbidden, but simply I ungranted, as, for example, where a railroad company undertakes to guarantee the expenses of a public festival. In the better usage, the term ultra vires is limited to acts of the latter 'class, and many of the Courts make a distinction between transactions which are illegal, because forbidden, and those which are simply in excess of the granted powers.”

In Steam Navigation Company v. Dandridge, 8 G. & J. 318, the Court said: “In Angelí and Ames on Corporations it is justly observed that a corporation and an individual stand upon very different footing. The latter, existing for the general good of society, may do all acts and make all contracts which are not in the eye of the law inconsistent with the great purpose of his creation ; whereas the former, having been' created for a specific purpose, can not only make no contract forbidden by its charter, which is, as it were, the latv of its nature, but in general can make no contract which is not necessary, either directly or incidentally, to enable it to answer that purpose. In deciding therefore whether a corporation can make a particular.contract, we are to consider in the first place, whether its charter or some statute binding upon it, forbids or permits it to make such a contract; and if the charter and valid statutory law are silent upon the subject, then, in the second place whether a power to make such a contract may not be implied on the part of the corporation as directly or incidentally necessary to enable it to fulfill the purpose of its existence, or whether the contract is entirely foreign to that purpose.” It was accordingly there held that the navigation company being incorporated only for the purpose of conveyance of passengers and freight, could not lawfully enter into a contract for breaking ice upon the waters navigated by its vessels, and towing other vessels through the track so made. And in Abbott v. Baltimore and Rappahannock Steamboat Company, 1 Md. Ch. 542, where the company was incorporated solely for the same purpose between Baltimore and Fredericksburg; but entered into an obligation in aid of an enterprise to improve the navigation of the river near Fredericksburg upon its own route, which would result to the great advantage of the company, it was held that the contract was not within its express or implied powers, and could not be enforced against it, though the obligee had incurred large expenses upon the faith of the contract. In the latter case the Chancellor followed the decision in the Dandridge case, supra, and that case has been repeatedly approved in this Court, upon the point here involved, the latest instance being in Boyce v. Trustees M. E. Church', 46 Md. 373. In State v. B. & O. R. R., 48 Md. 49, one of the questions was whether the receipts from certain hotels built and owned by the railroad company were subjected to the gross receipts tax imposed by the Act of 1872 upon such railroad companies, and the Court in construing the language employed in the power granted “to erect warehouses and other works necessary and expedient for the completion and operation of the road,” said on pages 76 and 77: “Hotels or buildings for the accommodation of passengers over the road are, we think, necessary to its business and therefore within its charter. * • * * The gross receipts therefore from these hotels are exempt from taxation.. The Oakland and Deer Park hotels, however, appear to have been built and are now used primarily as places of summer resort, and although as such they may attract travel over the road, they are not in any sense necessary to its operation. But the receipts from these hotels are not liable to the tax imposed by the Act of 1872, because they are not derived from the exercise of any franchise granted by the State, and they must be taxed according to valuation as other property.” The Court had previously said upon the same page, “It is hardly necessary to say that the original charter does not authorize the appellee to build and conduct hotels in the usual and ordinary manner in which hotels are kept, that is for the accommodation of the public generally.” The power to build and conduct such hotels was not actually before the Court under any of the pleadings in that case, and the language last cited therefore may perhaps be regarded as obiter, but the application of the gross receipts tax to such hotels was before the Court, and it was held not to apply to them because “the receipts were not derived from the exercise of any franchise granted by the State” — in other words, because the charter did not, either expressly or by implication, grant the power to engage in that business.

The cases we have cited from our own Courts sufficiently show how the law has been held in this State, and they are in accord with the best considered cases elsewhere in this country and in England. Thus in Davis v. Old Colony R. R., 131 Mass. 258, in which the subject was exhaustively considered by Judge Gray, it was held beyond the power of a railroad corporation, chartered by the Legislature, or of a corporation organized under the general law for the manufacture and sale of musical instruments, to guarantee the expenses of a musical jubilee and festival, and that no action could be maintained against either corporation upon such a guarantee, though made with reasonable belief that the holding of such festival would be of great pecuniary advantage to such corporations by increasing their proper business, and though the festival had been held and expenses incurred in reliance upon the guarantee. •

In Elevator Co. v. Memphis and Charleston R. R. Co., 85 Tenn. 703, the charter of the railroad gave it power “to do all lawful acts properly incident to a corporation, and to the transaction of the business for which it was incorporated, and also such additional powers as may be convenient for the due and successful execution of the powers granted in the charter.” The railroad company guaranteed eight per cent dividends upon the stock of an elevator company which built a grain elevator upon the line of the railroad but the Court held the guarantee could not be enforced, saying, “In no part of the grant of power, is that of guaranteeing the success ot another institution, person or corporation, to be found, either in expression or implication.”

In Pearce v. Madison and Indianapolis R. R. Co., 21 Howard, 441, the Supreme Court of the United States held that two corporations created to construct distinct lines of railroad leading to Indianapolis had no right without authority from the Legislature to consolidate into one corporation, and thereby to subject the capital of the one to- answer for the liabilities of the other. The managers had also established a steamboat line to run in connection with these railroads, and the Court held this to be “a departure from the business they were authorized to conduct, thereby diverting their capital from the objects contemplated by their charters, and exposing it to perils for which they afforded no sanction.”

In Coleman v. Eastern Counties Railway, 10 Beavan, 1, where the railway company proposed to guarantee the profits of a steam packet company to run in connection with the railway, Lord Langdale, Master of the Rolls, restrained the company by injunction, saying: “To look upon a railway company in the light of a common partnership, and as subject to no greater vigilance than these, would be greatly to mistake the functions they perform and the powers which they exercise, which are given by Act of Parliament, and which extend no farther than is expressly stated in the Act, or is necessarily and properly required for carrying into effect the undertaking and works which the Act has expressly sanctioned. * * *

.But it has been contended that they have a right to pledge without limit the funds of the company for the encouragement of other transactions, however various and extensive, ‘ provided the object of that liability is to increase the traffic upon the railway, and thereby to increase the profit to the shareholders. There is, however; no authority for anything of that kind.”

And in East Anglian Railway v. Eastern Counties Railway Co., 11 C. B. 775, where a similar guarantee was under consideration, it was held ultra vires, the Court declaring the question' to be one exclusively of power, and asking the unanswerable question, “What additional power do they acquire from the fact that the undertaking may in some way benefit their line? For whatever be their object or prospect of success, they are still but a corporation for the purpose of making and maintaining their railway.”

These cases which we have selected from the many that could be cited, sufficiently illustrate the principle which requires us to hold, as we do, that the agreement in this case is ultra vires.

But it is contended for the appellee that as the contract has been partly executed by both parties the railroad company is estopped to set up that defense.

Let us see how far this contention can be justified.

Judge Seymour D. Thompson in continuation of the passage from which we have quoted above, io Cyc. 1146, says: “Such a contract will not be enforced by any species of action in a Court of Justice; being void ab initio, it cannot be made good, by ratification, or by any succession of renewals, and no performance on either side, can give validity to the unlawful contract, or form the foundation of any right of action upon it.’’ It is true that the same distinguished author says, on page 1156 of Cyc. “The great mass of judicial authority seems to be to the effect that where a private corporation has entered into a contract in excess of its granted powers and has received the fruits or benefits of the contract and an action is brought against it to enforce the obligation on its part, it is estopped from setting up' the defense that it had no'power to make the contract.” This must be understood to mean however, that the fruits or benefits of the contract must have been received from the other contracting party, and not from outside parties. That this is the true meaning of the passage, appears from the language of the same writer on page 1155 of Cyc., where he says, “If the contract of a corporation is ultra vires, but not immoral or otherwise malum in se, and either party disaffirms it on the ground that it is ultra vires, and refuses further execution of it, then, while the other party cannot sue to recover damages or compensation in respect of the unexecuted portion of the contract, yet the law will afford him remedies for procuring from the other party a restoration of what he has lost under it. The governing principle is that where money has been paid or property transferred to a corporation, under a contract which is not malum in se, the party receiving may be made to refund to the party from whom it has received, the value of that which it has actually received, and to this end he may maintain against the corporation the equitable common law action for money had and received.” In Johnson v. Hines, 61 Md. 131, where the question under consideration was what title passed to mortgagees under a mortgage from one whose title was derived from an unauthorized conveyance by a trustee, Judge Yellott speaking for this Court, said: “That nothing can emanate from nonentity, or, as more tersely enunciated, de nihilo, nil, is an axiom in the physical sciences which might be appropriately transferred to a judicial investigation of this nature.” This is certainly sound logic, and a void contract can no more give rise to a right of action upon such contract, than a void deed can create title in the grantee.

In Thomas v. West Jersey R. R., 101 U. S. 71, the railroad company made a twenty-year lease of its road, which was acted under for five years and was then repudiated by the railroad and the other party brought suit upon the contract. It was held void as ultra vires, but the' doctrine of estoppel was invoked by the plaintiff on the ground that the contract had been partly performed. The Court said: “It was the duty of the company to rescind or abandon the contract.' Though they delayed this for several years, it was nevertheless a rightful act when done. Can this performance of a legal duty, a duty both to the stockholders and the public, give the plaintiff a right of action ? To hold that this can be done, is in our opinion to hold that any act done under a void contract makes all its parts valid, and that the more you do under a contract forbidden by law, the stronger the claim to its enforcement in the Courts.”

In Central Transportation Co. v. Pullman Palace Co., 139 U. S. 62, under a contract held ultra vires, the Supreme Court again held that part performance was no ground for enforcing further performance of an unlawful contract, though the Pullman Company was required to account in an independent proceeding for the value of what it had received from the plaintiff under the contract, saying: “In such case the action is not maintained upon the unlawful contract, nor' according to its terms, but on an implied contract to return, or failing to do that, to make compensation for the property or money which it had no right to retain. To maintain such an action, was not to affirm, but to disaffirm the unlawful contract.” This is the doctrine of a majority of the State Courts of highest repute.

In Morville v. American Tract Society, 123 Mass. 137, the Court said: “The plaintiff’s money was taken and is still held by defendant under an agreement which it is contended it had no power to make. *. * * The plaintiff is not seeking to enforce the contract, but only to recover his own money and prevent the defendant from unjustly retaining the benefit of his own illegal act.”

In Day v. Spiral Springs Buggy Co., 57 Mich. 147, in a suit upon a speculative contract which was held ultra vires, the defendant pleaded in estoppel on the ground of part performance, but the Court, through Judge Cooley, said: “There are some decisions which give plausibility to the position of the. defendant, but we know of none that is adequate to the exigencies of this case. * * * The power on the part of such a corporation to enter into contracts of speculation, being withheld on reasons of public policy, for the protection of shareholders and the general good of the community, the act neither of one party nor of both, in entering into it can work an estoppel against setting up the invalidity. A rule of law established for the public good cannot be thus defeated. A corporation cannot, by the mere act of individuals, be given a power which tne State for general reasons has withheld from it. Steam Navigation Co. v. Dandridge, 8 G. & J. 248, 319. Parties may be estopped in some cases from disputing the validity of a corporate contract when it has been fully performed on one side and when nothing short of enforcement will do justice. To quote the language of Comstock, C. J.,in Parish v. Wheeler, 22 N. Y. 508, ‘the executed dealings of corporations must be allowed to stand for and against both the parties when the plainest rules of good faith so require.’ But this is not such a case. The contract has only been performed in part. * * * No valid' ground for estoppel is therefore found to exist in the case.”

Our own decisions have distinctly recognized the principle of the cases we have cited above. In Maryland Hospital v. Foreman, 29 Md. 524, the hospital had received money from Foreman under a contract which the Court said was not authorized by the powers conferred in its charter, and was therefore “simply ultra vires, and not binding upon the parties and Judge Bartol said: “The contract in all such cases will be regarded as void, and the party who delivered the property or advanced the money to the corporation will be entitled to his legal remedy, not founded upon, but in repudiation of the contract, to recover the property or the money from the corporation, upon the principle that it had acquired no right or title to either under the contract.”

So in Lester v. Bank, 33 Md. 563. The appeal was from an order ratifying an auditor’s account and allowing a claim for a debt due upon a loan made by the bank in violation of its charter, and the order was affirmed, the Court saying that “in cases arising under contracts made in violation of a statute^ it has been repeatedly held that an action would lje against a party receiving money under such a contract upon a promise implied by law to refund it.”

In Weckler v. First Nat. Bank, 42 Md. 582, the bank sold bonds on commission in violation of its charter powers, but paid over the proceeds to the owners of the bonds, and it was held that not having any of the plaintiff’s money obtained by means of the sale of the bonds, the defense of ultra vires was open to it.

In United German Bank v. Katz, 57 Md. 141, where the bank discounted a note in excess of its charter powers, a recovery was allowed upon the note, though the plea of ultra vires was made, but the principle upon which it is allowed, was stated to be “that it is inequitable to permit one who has received the benefit of the contract to repudiate it on the ground that the corporatiori from which he received the benefit had no power to make the contract;” so that the form of recovery, and not the substantial right of recovery was the thing in question there. This is the only case in Maryland to which we have been referred in which a recovery directly upon the void contract has been allowed at law. The case of Heironimus v. Sweeney, 83 Md. 146, like Lester v. Howard Bank,. was an equity case, and where the defendant has retained the fruits of the void contract, the plaintiff may either resort to the common law action for money had and received, or to an accounting in equity.

(Decided December 8th, 1905.)

The case of Bank v. Katz, supra, was cited in Black v. Bank of Westminster, 96 Md. 429, but in the latter case the declaration contained the common counts as well as a special count on the noté, and the recovery by the bank might be properly attributed to those counts, even if the note had been held to be purchased instead of discounted as it was held to be; and both those cases were cases of fully executed contracts in which the defendant sought to retain the fruits of the contract.

In this case, there is but one count in the declaration, and that is upon the void contract, and the proof is clear that the railroad company never received from the hotel company, either directly or indirectly, any money or property whatever under this contract. The only money it has received as a result of the contract, is that paid by passengers for transportation over its own road, or for freight carried over the road. The hotel company has paid nothing, and parted with nothing under this contract, and is therefore under all the authorities without any right of action.

It follows from what we have said that the demurrer to the defendants’ fourth plea should have been overruled, and the defendants’ first and second prayers should have been granted, and for the error in sustaining the demurrer and refusing those prayers, the judgment must be reversed. As there can be no recovery under our view of this case, it is unnecessary to consider the other rejected prayers of the defendant.

Judgment reversed without a new trial. Costs above and below to be paid by the appellee.  