delivered the opinion of the court.
That the city of Litchfield had legal power to lease its waterworks property or contract for its improvement and operation by another party, we have no doubt. That authority was expressly given in the charter under which the city operated. Independent of such expressed authority it had the power, because the property was held and operated by it as a private corporation, as contradistinguished from its governmental capacity.
When a municipal corporation undertakes to construct and operate waterworks, it does so in the exercise of its private and not of its governmental functions. Wagner v. City of Rock Island, 146 Ill. 139.
But while the city had the power to make a contract for the leasing of the property or its operation by another it was not authorized to make the particular contract that was made with appellee. It was not such a contract as either party could enforce in a court of equity or recover damages for a breach of in a court of law; in other words, the contract of lease of July 31, 1891, was at its inception invalid. That stands admitted by both parties to the controversy, and for that reason it • is not necessary to point out the features that make it invalid. It is assumed by appellant that appellee in resorting to a court of equity to restrain proceedings at law for the possession of the water works property plant its suits upon the principle of the private corporation which has made a contract in excess of its corporate powers will, when the contract has been performed by the other party, be precluded from availing itself of the original invalidity of the contract. Appellant then lays down the proposition that if the fact of performance-by the water supply company cured the original invalidity of the contract it could avail itself thereof at law, and can not, therefore, resort to a court of equity with such defense.
It insists, however, that the lease was not made valid by the fact that the water supply company performed its obligations thereunder. Quite a list of authorities is submitted in support of the proposition that the fact of performance by the other party, of a contract with a municipal corporation, which the corporation had no power to make, does not make the contract valid and enforcible against the corporation. As a proposition of law it must be conceded that appellant is correct in such insistence. As we understand it, however, appellee does not contend that the contract has been made valid and enforcible by r.eason of the performance on its part. It is not seeking an enforcement of "the lease, but merely remuneration for the improvement which it has placed upon appellant’s property, and to that end asks that it may not be disturbed in its possession of the property until the amount of remuneration shall be ascertained and paid. Its theory is not, as assumed by appellant, that the lease, although void at its inception, has become valid by reason of appellee’s performance; but that the city, having power to make a lease of its waterworks, and having made the lease in question, and appellee having performed all the conditions in the case required of appellee, is estopped from such repudiation of its contract as will enable it to appropriate without compensation all the improvements placed upon the property by appellee, although the lease was invalid at its inception.
In considering the lease involved we should observe the distinction between the terms void, voidable and invalid, as applied to contracts. That contract is void which is made without power to contract or which is inhibited upon grounds of public policy; that contract is voidable or invalid which the law says should not have been made as it was made. In case of a contract absolutely void neither party has redress in either law or equity, and where a municipal corporation enters into a contract concerning a matter about which it had no power to contract, no implied obligation arises to compensate the other party for what he may have done under the contract, notwithstanding the corporation may have received a benefit therefrom. In case of a voidable or invalid contract circumstances may arise which render it inequitable for one of the parties to repudiate it without restoring to the other what he has received from the other. Void and invalid contracts concerning interests in real estate stand upon the same footing in a court of law; in that forum the legal title must prevail; but where a party by ejectment in a court of law seeks to repudiate his invalid contract, and to permit him to do so would be contrary to equity and good conscience, a court of chancery will stay the prosecution of the ejectment suit and allow the defendant therein to assert and maintain an equitable estoppel. Estoppel in pais affecting interests in land, can not be involved in an action in ejectment, and can only avail in a court of chancery. Mills v. Graves, 38 Ill. 466; Blake v. Fash, 44 Ill. 302; Winslow v. Cooper, 104 Ill. 235.
The doctrine is firmly established in our State that estoppel in pais is applicable to municipal corporations as well as to private corporations, and individuals, when acting in private capacity, as contradistinguished from governmental capacity. Martel v. East St. Louis, 94 Ill. 67; East St. Louis v. East St. Louis Gas Light and Coke Co., 98 Ill. 415; City of Chicago v. Sexton, 115 Ill. 230; Gregsten v. City of Chicago, 145 Ill. 451.
The city of Litchfield entered into this contract in its private capacity as contradistinguished from its governmental capacity. It had the power to contract for a lease of its waterworks, but the contract made was invalid, because of the long and indefinite period it was to run. Because of that invalidity it could not be enforced. But the parties acted under it for several years, and the bill shows that appellee expended over $20,000 enlarging and improving the property. It shows that the improvements are lasting and valuable. Appellant, after having in various ■wavs recognized the contract as valid and induced appellee to make the improvements, now elects to repudiate the contract and in a court of law recover possession of the property without any remuneration whatever. In our opinion there is presented a most fitting case for equitable interference.
The case of Cook County v. City of Chicago, 158 111. 524, largely relied on by appellant, is readily distinguishable from this one. In that case certain property was conveyed by the State to the county, and the county was forbidden by statute to alienate it. The county made a contract with the city of Chicago by which the city "was to erect a building on the property and have a right to use a portion of it. After the building had been erected and used several years the county brought ejectment. The city filed a bill in equity to enjoin the suit in ejectment, claiming that the contract having been performed on its part the county was precluded from asserting that the original contract was void. The Circuit Court and the Supreme Court both held the bill bad on demurrer and that the doctrine of equitable estoppel did not apply. But in that case there was no power to alienate. Hot only so, but the county was by law expressly forbidden to alienate. The contract was void, not merely voidable.
Ho injustice is done appellant by the terms of the decree. It only requires the city to pay for the value of the improvements as they now stand. In ascertaining the value it is given the option of agreeing with appellee, submitting to arbitration, as the contract provides, or of having the value fixed by the court. The decree is right and will be affirmed.