This is an appeal from a judgment for final writ of mandate, entered by the superior court of Pacific county. The action’was first brought in the name of the city as plaintiff, but by later stipulation the state was made plaintiff. Stated as briefly as possible, the amended complaint sets forth the granting of a franchise for constructing and operating water works in the city of South Bend, to the appellant — or rather to the South Bend Water Company, to whose rights the appellant succeeded; and it was authorized to build, operate, and maintain water works in the city under such provisions as are generally incorporated in franchises of this character. Among other things, it was required that the water works should be so constructed that the company would be able to furnish and maintain to the city and its inhabitants an adequate supply of pure, wholesome water for domestic, sanitary and manufacturing purposes, and should be able to furnish for fire protection a certain amount, etc. It was also provided that there should *179be twenty-five hydrants at stated locations,, and that - the number of hydrants might be increased. Section 10 of the ordinance stated that the city agreed to use said hydrants at a rental of $7.50 per hydrant per month, to be paid out of the general fund, and a sufficient tax should be levied and collected annually to make the payments for hydrants rented, which tax should be irrepealable during the franchise. There were other provisions in relation to the right of the city to buy the water works under certain conditions and at certain times, and a provision requiring the grantee to change the then present source of supply when it became impure or inadequate. The complaint, in short, charged that the defendant had violated its franchise duty, and had neglected to furnish an adequate supply of water.
The amended answer admitted the formal allegations of the amended complaint, assignment of franchise to defendant, and its operation and ownership of the plant, and denied all of the substantial charges of failure to give the required service, excepting that for brief periods and sundry times, owing to accident and other causes not due to its fault, there had been interruptions in its mains and stoppages in its supply ; but alleged that, they had been repaired ,and restored as rapidly as possible; admitting that a few of the residences had been placed at such an -elevation that it was not possible to convey water to them.
For a separate affirmative defense, the defendant pleaded that, in July and August, 1891, negotiations were had with a view to the construction of a system of water works for the city, which was then of about one thousand population; that it was agreed that the city should grant the franchise for thirty years, and that the South Bend Water Company should install and maintain fifty hydrants for fire protection, at the monthly rental of $7.50 each, and an ordinance to that effect was passed; that the terms of this contract were mutually interdependent and indivisible; that to obtain the necessary capital and comply with the terms of the ordinance *180and afford proper security to investors, it was necessary that the company should have some certainty of a substantial income whereby it could meet its expenses of operation and fixed charges; that at that time the assessed valuation of the property of the city was $2,368,000, and that there was no outstanding debt except a bonded debt of $60,000; that in reliance on this franchise and the hydrant rental, the company raised the necessary capital by loan and constructed this system; that as originally built it was operated by steam power, the works being partly constructed in 1891-2; that ■disputes arose between the company and the city as to the company complying with all the terms of the ordinance, litigation ensued, and compx’omise was agreed to whereby, as a substitute for Ordinance No. 100, the ordinance just above referred to, a new ordinance was passed, in similar terms, except that instead of fifty hydrants the company was to install and receive rent at the same rate for only twenty-five hydrants, with privilege on the part of the city to order an extension of mains,- etc.; that the city, in order to pay for ■the hydrant rental, was to raise money by general taxation. On April 3, 1893, Ordinance No. 118 was passed by the city council as a substitute for said Ordinance No. 100, and the company proceeded with the construction of its system, and installed the twenty-five hydrants by July 7, 1893, and supplied water through its said system to the inhabitants of the city and provided fire protection by means of hydrants.
On July 17, 1893, and until March 1, 1894, the city issued and delivered its warrants for hydrant rental, but none of them has ever been paid. In consequence of the general collapse of credit and decline of business throughout this and other states in 1893 and 1894, the city’s business and population were checked, and in 1894, 1895, and 1896, the actual volume of business and population of the city progressively declined, and the assessed valuation progressively fell, while the city’s debt rapidly grew. The assessment of June, 1892, was- $1,908,000. In October, 1893, it was $520,000. The *181general city debt in excess of the bonds in October, 189S, was $21,500, and in 1894, was about $26,000. The principal of the bonded debt remained unpaid, and part of the accrued interest was unpaid. The assessed valuation of the city at no time since 1894 has exceeded $1,000,000.
By reason of the default of the city to pay its hydrant warrants, the South Bend Water Company became embarrassed, and a mortgage foreclosure suit in the United States circuit court in 1894 resulted in a receivership, and the receiver for some time operated the property by order of the court. By order of the court he also brought an action against the city to recover the hydrant rentals, and upon a trial on the merits in the United States circuit court in 1895, judgment for the defendant was entered, upon the ground that, although the city was not indebted in excess of its constitutional limit when the franchise by Ordinance 118 was granted, it was so indebted when the hydrant' service began in July, 1895, and so remained, and that the city under the state constitution could not incur any indebtedness for hydrant service under said franchise when it was indebted over its constitutional limit. Upon a writ of error to the United States circuit court of appeals from this judgment, it was affirmed. On account of financial embarrassment and decline of income, the South Bend Water Company was reorganized, and this defendant was incorporated by its creditors and principal stockholders in 1895. The franchise and water works were acquired, the motive power was changed from steam to gravity, the original source of water supply was abandoned, and other sources obtained.
Upon the trial of the cause, the court found that the defendant had failed to supply water as alleged in the complaint, in violation of its contract, and the writ of mandate was issued as prayed for. From such order this appeal is. prosecuted, the contention being, (1) that there was no obligation on the part of the defendant to comply with the con-, tract, for the reason that the contract made with the city was *182an entire contract; and (2) that the trial of the cause resulted in the showing that the defendant, as a matter of fact, had not failed to supply the water required by the ordinances.
On the first question there seems to be a dearth of authority on the particular propositions involved in this case. The appellant recognizes the inapplicability of the authorities generally, but cites as instructive litigation bearing on the principles involved in this case Winfield v. Winfield Water Co., 51 Kan. 70, 32 Pac. 663, and the companion case of Winfield Water Co. v. Winfield, 51 Kan. 104, 33 Pac. 714. But the decisions in those cases fail to reach the contested proposition here. In the first case cited, however, as bearing upon the right of the city to bring this action for the benefit of the residents of the city, it is decided that there is no such privity between the private citizen and the water company as would give the citizen a right to compel the company to perform its contract with the city, and further that it is not only the privilege but the duty of the city to compel the water company to furnish the citizens with water in accordance with its contract. This question, however, is set at rest in this case by the intervention of the state, and further by stipulation of the parties that the defendant would raise no objection to the form and nature of the action, and that *the case should be tried upon its merits. It must be admitted that the case is beset with difficulties, and that injustice to a certain extent will be inflicted whichever way it may be determined. There is much force in the contention of learned counsel for áppellant that this should be construed to be an entire or indivisible contract, and it is urged with reason that the water company had a right to rely upon the performance by the city of its part of the contract, and that such reliance might have been the controlling motive in incurring the obligations' binding on the company; and it is argued that, where the considerations moving from each party to the- other are practically concurrent, the contract *183is indivisible, and that the failure to pay the consideration moving to the public service corporation is therefore a bar to an action for not rendering the service which it is obligated to render under the contract, when the action is brought by the party failing to pay.
This is no doubt the general rule, but peculiar conditions are involved in this transaction, and these conditions must be taken into account. In entering into this contract the city acted in a dual capacity. It acted for the city and stipulated for the protection of the city’s property. It also acted as agent for the residents of the city, which, as we have seen, it was its duty to do, the residents as individuals being practically powerless to obtain water, having no control of the streets of the municipality; and the contract for the rental of the hydrants was evidently a contract in the interest of the city as such. But, whether the contract is technically divisible or indivisible, if the theory contended for by appellant should prevail, the residents of the city would be left remediless, because, if the company can violate one part of its contract because of the failure of the city to pay its hydrant rental, it can with perfect impunity violate all of them in whole or in part. It has already lowered its plant one hundred and thirty-two feet, thereby necessarily reducing the altitude of its operations and making the water system ineffectual to a portion of the city which was within its reach before. By the same token it can reduce it one hundred and thirty-two feet more, and still further incapacitate itself. It can violate the ordinances in relation to prices charged, and plead in extenuation the failure of the city to pay its hydrant rentals. It can refuse to supply the residents of the city with pure water for domestic purposes or for any other purpose, except under conditions it sees fit to impose, without restraint or control, until the condition would become intolerable; while at the same time it is operating under the laws governing public service corporations and enjoying special privileges, using and occupying the streets of the *184city, protected in such use and occupancy by the franchise which it obtained through this very contract which it now says cannot be enforced against it.
If the city were now seeking to compel the company to furnish water for the operation of the hydrants for fire purposes and to comply with its contract in that respect, while it refused to pay the rental, the position of the appellant would be unassailable; or if the company had abandoned the contract as an entirety when it was breached by the city, and had vacated the streets, we apprehend the city would not have had power to compel the performance of a contract a portion of which it had failed to comply with. But in this case, after it had been judicially determined that the city was powerless to comply, for a time at least, with that part of the contract concerning the hydrant rentals, the company elected to proceed with the contract with that portion eliminated, and it is now estopped from pleading its indivisibility, for it cannot claim the benefit of that portion of the contract which subserves its interest and repudiate that portion which provides for the performance of a duty on its part. By its own act it has placed the construction of divisibility on this contract, and it has operated for many years under this construction. It is elementary that, where there is an ambiguity in the terms of a contract, courts will generally give it the construction placed upon it by the parties to it, especially where they have acted under it for a great length of time, and more especially where, as is shown by the testimony in this case, the water company has frequently promised during all these years to improve the system so that it could furnish water in compliance with the terms of the contract.
On the merits of the case, a careful examination of all the testimony convinces us that the findings of the trial court are fully justified. There being no error committed by the court in the admission or rejection of testimony, or in any other respect, the judgment is affirmed.
Rudkin, O. J., Crow, Mount, and Parker, JJ., concur.