delivered the opinion of the court.
This is an action by motion for the recovery of a judgment for money. The facts are few and the issue simple.
Designating the parties as they were designated in the trial court, plaintiff’s claim grows out of a contract under which materials were furnished and work done in and about the construction of a water main for the town. They owned a filling station about a thousand feet north of Mount Jackson, on the Valley pike, and were anxious to secure town water, while the town on its part wished to extend its mains to new customers, plaintiffs included. Out of this situation the contract sued upon was executed. Originally a one and one-half inch pipe was intended, but to insure a more ample flow a two inch pipe was afterwards substituted, that others living along its length might also be supplied. This pipe line tapped the old main at a point .631 feet within the corporate limits, and extended beyond those limits for 1,081 feet along the pike and over a right of way procured by the town. After this work was done, the personnel of the town council changed, as did its policy. No water was ever turned in, and this action is brought to collect a balance due on account of this construction. In the notice of motion one count is on contract and one on a quantum meruit. The amount or justness of the demand is not in dispute, but the town does contend that it should not be made to pay at all because the contract in judgment was ultra vires.
To support this it is said that the power of the town over its water supply and works is written into the statute, and appears in section 3031 of the Code, and that nowhere there is it given authority to supply *400water to others than to its own citizens. It is further said that even if such power were given, it would be unconstitutional, in that a city may condemn land to supply water for its own needs, that being a public purpose, but that to do so in order to supply those beyond its own limits would be in effect to take private property for private purposes. Fallsburg, etc., Co. v. Alexander, 101 Va. 98, 43 S. E. 194, 61 L. R. A. 129, 99 Am. St. Rep. 855; Miller v. Pulaski, 109 Va. 137, 63 S. E. 880, 22 L. R. A. (N. S.) 552.
These are interesting questions, but they are not necessarily involved in this suit. Plaintiffs are not suing for water, and water rights are only indirectly an issue. They are entitled to judgment if the contract is lawful, and they are entitled to judgment if the evidence supports a quantum meruit recovery, even though the contract be ultra vires, as we shall presently see.
It is true that the power of a town to establish water works is conferred for the benefit of its own citizens, but it is also true and it is to be remembered, that the power to take is not limited to its present needs, Miller v. Pulaski, 114 Va. 85, 75 S. E. 767.
For the purposes of this case, and for those purposes only, it may be conceded that the statute in question confers no authority on a town to supply water generally to those who live beyond its corporate limits.
The rule applicable in the construction of such charter powers has been thus stated by Judge Dillon: “The purpose for which a municipality is authorized to construct water works or to contract for a supply of water is usually to supply its own needs and the needs of its inhabitants, and it may be laid down as a general rule that a grant of power to a municipality for these purposes gives it by implication no authority to enter *401into the business of furnishing water to persons beyond the municipal limits.” Dillon on Mun. Corp., section 1299.
This general rule is subject to this reasonable qualification: “When a city owns, maintains and operates its own water or light plant, it is to be reasonably expected that in the prudent management of its works some excess beyond the natural requirements of the public will arise; that there will be some surplus which will be available for disposal over and above such as it requires for its own purposes and such as its inhabitants can claim by reason of the prior duty which it owes them. With reference to the surplus so arising, the city may contract with private individuals for the private use thereof so long as it does so without affecting the supply which is required for public or quasi-public purposes.” Dillon on Mun. Corp., section 1300.
In Pike's Peak Power Co. v. City of Colorado Springs (C. C. A.), 105 Fed. 1, the court, speaking through Judge Sanborn, said: “It is true, as counsel for the city assert, that the water, the water system, and the other public utilities of a municipality are held by it and by its officers in trust for its citizens, and for the public; that neither the city nor its officers can renounce this trust, disable themselves from performing their public duties, or so divert or impair these utilities that they are rendered inadequate to the complete performance of the trust under which they are held. Union Pac. Ry. Co. v. Chicago R. I. & P. Ry. Co., 51 Fed. 309, 317, 2 C. C. A. 174, 231, 10 U. S. App. 98, 175, and cases there cited. But it is equally true that municipalities and their officers have the power, and it is their duty, to apply the surplus power and use of all public utilities under their control for the benefit of their cities and citizens, provided always that such *402application does not materially impair the usefulness of these facilities for the purposes for which they were primarily created. * * * This court held, after careful consideration, and its decision was subsequently affirmed by the supreme court (Union Pac. Ry. Co. v. Chicago, R. I. & P. Ry. Co., 163 U. S. 564, 16 Sup. Ct. 1173, 41 L. Ed. 265), that, if' a corporation necessarily acquires for the conduct of its corporate business facilities whose entire capacity is not needed for its corporate uses, it is not required to hold them in idleness; but it has the power, and it is its duty, alike to its stockholders and the public, to lease or otherwise apply the surplus use for their benefit.”
In Rogers v. City of Wickliffe, 29 Ky. Law. Rep. 587, 94 S. W. 24, the court said: “The case of the City of Henderson v. Young, [119 Ky. 224] 83 S. W. 583, 26 Ky. Law. Rep. 1153, is conclusive of this case. In that case the court said: ‘In the management and operation of its electric plant a city is not exercising its governmental or legislative powers, but its business powers, and may conduct it in the manner which promises the greatest benefit to the city and its inhabitants in the judgment of the city council, and it is not in the province of the court to interfere with the reasonable discretion of the council in such matters.’ This applies to furnishing water by a city as well as electricity. The contract with Henderson appears, from its terms, to be a beneficial one for the city. If, however, it was made to appear that to furnish Henderson there would not be sufficient water remaining to supply the residents of the city, the ease would be different.”
These authorities also hold that a city may sell to persons beyond their corporate limits surplus water and power. Dyer v. City of Newport, 123 Ky. 203, 94 S. W. 25, 29 Ky. Law. Rep. 656; Milligan v. Miles *403City, 51 Mont. 374, 153 Pac. 276, L. R. A. 1916C, 395; State v. City of Eau Claire, 40 Wis. 533; Green Bay & M. Canal Co. v. Water Power Co., 70 Wis. 635, 35 N. W. 529, 36 N. W. 828; Richards v. City of Portland, 121 Ore. 340, 205 Pac. 326; Board of Commissioners of Larimie County v. City of Ft. Collins (Colo.) 189 Pac. 929; City of Henderson v. Young, 119 Ky. 224, 83 S. W. 583, 26 Ky. Law Rep. 1152; Paris Mountain Water Co. v. City of Greenville, 110 S. C. 36, 96 S. E. 545; Andrews v. City of South Haven, 187 Mich. 294, 153 N. W. 827, L. R. A. 1916A, 908, Ann. Cas. 1918B, 100; Pond on Public Utilities, section 8.
Common sense requires us to hold that a city in the possession of surplus water, lawfully acquired, should not permit it to run to waste when it can be sold at a profit.
Among those cases strongly relied upon to sustain the general proposition that cities have no power to dispose of such commodities beyond their corporate limits, is Hyre v. Brown, 102 W. Va. 505, 135 S. E. 656, 49 A. L. R. 1230, but in that case this significant statement is made: “The exception to the general rule is that there is implied power to furnish an excess commodity to outsiders where the city has such commodity in the exercise of an authorized proprietary undertaking, under the theory that it is ‘good business.’ The instant case does not fall within the exception noted, for there is no suggestion herein of surplus commodity, or ‘good business.’ ”
The City of Sweetwater v. Hammer (Tex. Civ. App., 1923), 259 S. W. 191, is also relied upon. In that case a water main appears to have been built for the single purpose of supplying a gypsum grinding plant two and a half miles away, and to pay the expenses thereof ten year warrants were issued, but it was there conceded *404that a city had the right to sell its surplus water. Without further discussion of this phase of this ease, we are of opinion that such right undoubtedly exists.
There are cases which hold that even though a city may sell its surplus power, or water, it can make no connections designed for delivery, and can do business only on a cash and carry basis; that the purchasers must come for what they want and make at their own expense the necessary connections, such as Dyer v. City of Newport, and City of Sweetwater v. Hammer, supra. In this last case it was said that if a city might extend its mains for ten feet, it might extend them for uncounted miles. There is reason in all things. The consolidation of two cigar shops is no combination in restraint of trade.
In Board of Commissioners of Larimee County v. City of Ft. Collins, supra, the question of repayment to consumers who lived without the city the cost of constructing mains was involved. In that case the court said: “Under the authorities already cited, and many others, it is well settled that a city in operating a water works system acts in its proprietary or business, and not in its political or governmental, capacity, and in so acting is governed largely by the same rules that apply to a private corporation. From this proposition it follows that, as stated in 19 R. C. L. 788, section 95: ‘When, * * * as a necessary result of carrying on a legitimate public enterprise in a reasonably prudent manner, a surplus of the material used or distributed is acquired, or a by-product created, a municipal corporation may lawfully engage in the business of disposing of such surplus or by-product for profit, without special .legislative authority.’ In Milligan v. Miles City, supra [51 Mont. 374, 153 Pac. 276, L. R. A. *4051916C, 395], it was said: ‘If it has a present surplus of water * * * the dictates of common business prudence require that such surplus be sold, and the proceeds devoted to public use.' It was accordingly held in the case last above cited, that a municipal corporation, having express authority to operate an electric light and power plant, may lawfully, as an incident thereto, sell surplus steam, and further may, at public expense, lay the mains or conduits necessary to convey such surplus steam to places where there is a demand for its use. In that case, the business of selling surplus steam was conducted entirely within the corporate limits, but a surplus product, like water or light, may, of course, be sold to consumers without the city, and, if so, mains or conduits may be laid to points without the city in order to convey the surplus product ‘where there is a demand for its use.’ The laying of mains and the furnishing of the water are both a part of the same business enterprise. There is no rule that limits the disposal of surplus products only to cases where it may be done without any expense whatever.”
In Andrews v. South Haven, supra, the court said: “The electric light plant which defendent owned and operated, although a municipal public utility, was a business concern or enterprise. In its operation and business management the city had the right and power to do those things naturally connected with and belonging to the running of such a business which a private corporation would have in the same connection. Pond. Pub. Utilities.”
The measure of expense which a town may incur in disposing of its surplus supply of water should be governed by the town’s good judgment. That discretion is not abused when the transaction results in a profit to the town, as would be the case here had water been furnished.
*406It follows from what has been said that the town had a right to sell its surplus water, and as ancillary thereto had the right to lay pipes (if otherwise authorized to this end). It also follows that it is liable for necessary expenses incurred in so doing. The possibilities of abuse in no wise limit the power.
In the case in judgment, surplus water was in the minds of the contracting parties. The agreement under which the work was done provides in part as follows: “The said party of the first part, in consideration of the laying of the said two (2) inch pipe, and in further consideration of the premises, and the payment of rental hereinafter provided, agrees that the said parties of the second part shall have a reasonable supply of water from the system of the town of Mt. Jackson, so long and whenever there is an adequate supply of water, and especially so long and whenever, the water is supplied by the said town .to its citizens for other than domestic use, the intention being that the said parties of the second part shall b.e supplied with water whenever persons of the. town of Mount Jackson are allowed the use of water for other than household purposes.”
The contract, in substance, amounts to this: The town said to the plaintiffs: “If you will build this main for us, we will pay you for your work and furnish you water,” and it now refuses to pay for the work because it claims that it cannot be compelled to furnish water. Mt.. Jackson, like most towns in Virginia, has a surplus of that commodity, except in periods of dry weather, and has the power to furnish it so long as no hardship is inflicted thereby on its own citizens. That bridge has not been reached.
This contract, to the extent that it attempts to put these plaintiffs on. the same footing that non-domestic *407users of water in the town stand is unlawful. The town went beyond its authority in this particular, and so to that extent the contract is ultra vires, but attention is again called to the fact that this is not a suit for water. If the pipe had been laid as a private pipe for the purpose of supplying the plaintiffs’ filling station alone, there might be no way to disassociate the laying of the pipe from the uses to which it was to be put. But this is not our case. The town secured the right of way and required that the pipe placed thereon should be large enough to accommodate other consumers also, and “T” connections were placed on it for that particular purpose. It is a city main, designed to be used as other city mains are.
If this entire contract were ultra vires, plaintiffs could still recover on a quantum meruit. The town has retained and controls this main designed for the benefit of consumers generally and through which they can deliver water at a profit. In such circumstances the obligation to pay is as complete as it would be to pay for a right of way bought and held for this pipe. No one would claim that it could keep such an easement and not pay for it. Citizens’ Nat. Bank v. Appleton, 216 U. S. 196, 30 S. Ct. 364, 54 L. Ed. 443; Tone v. Tillamock City, 58 Ore. 283, 114 Pac. 939; Norton Grocery Co. v. Bank of Abingdon, ante, page 195, 144 S. E. 501, decided September 20, 1928; Elliott on Contracts, section 559.
It is a common custom for municipal corporations in Virginia to furnish water to those who live beyond their limits. This is a source of profit to them, contributes to the sanitation of the outlying districts and indirectly to that of the towns themselves. To discontinue this would, in many instances, be disastrous, and would redound to the injury of all concerned *408without corresponding benefit of any kind to anybody. When to sell and when not to sell must be left as other matters of business are left to their sound judgment.
For the foregoing reasons we are of opinion that the judgment complained of should be affirmed, and it is so ordered.
Affirmed.