The plaintiffs Keith and Perry are the owners of a lot in Kansas City fronting one hundred feet on Walnut street and running back one hundred and fifteen feet to an alley, and the defendant Ridge is the owner of a contiguous lot of the same frontage and depth.
On the seventh off July, 1886, the parties entered into a written contract which provided as follows:
“1. Thatwhichever party shall first build adjoining said lines, shall erect a party wall thereon, half on each side thereof, of such depth as such party shall see fit, and of sufficient strength and thickness to sustain a building of not less than five stories in height, of good material and workmanship, and in conformity with the building laws for the time being in force, and shall keep the same in repair until used by the owner of the other parcel; after which the same shall be kept in repair at the joint expense of the owners of said adjoining parcels of land for the time being.
“2. That whenever the owner for the time being of the other parcel use said wall, he shall pay to the person at the time of such use owning the parcel first built upon, one half of the then value of such wall, including in the word ‘wall’ the stone and brick foundations and any other sub-structure, together with the coping.
*94“3. That either party, his or their heirs or assigns on either side, may build said wall higher or deeper, taking due care not to injure the other owner, and doing the work wholly from his or their side, unless the other side be vacant, and doing all that may be necessary, as by carrying up flues and the like to leave the other owner as near as may be in as good condition as before, and using good material and workmanship and conforming to existing building laws; and one half of the value of any such additions when used shall be paid for like the original structure.”
Soon after the agreement was made the plaintiffs, •Keith and Perry, commenced the erection of a building on their lot, six stories high on Walnut street and seven stories on the alley, the centre of' the south wall of which was, in pursuance of the agreement, located on the dividing line between their lot and that of the defendant Ridge. The foundation of the wall was of stone, solid and continuous from Walnut street to the alley. The remainder was of brick laid continuously thereon, except that from about two feet above the stone foundation and about fifty feet from the front wall the plaintiffs recessed their south wall on their own lot for a distance of sixteen or seventeen feet to the top, thus leaving a space of that length of the wall unoccupied by their building, thereby forming a court therefor on their own premises, for the purposes of light and ventilation. Their building was completed sometime in the year 1888, and in the year 1890, the defendant erected a building on his lot of the same depth, four stories high on Walnut street and five stories high on the alley, using the wall thus constructed by the plaintiffs for the north wall of his building, making the same a continuous, solid, blank wall between the two buildings by filling up the space aforesaid left by the plaintiffs as aforesaid, which ever since has *95been used and enjoyed by both parties as a party wall for tbeir buildings.
After the defendant had thus erected his building, the plaintiffs demanded payment of one half of the cost of the wall thus used by the defendant, and payment having been refused, this suit was instituted.
The petition is in two counts, the first upon the contract, the second upon a quantum meruit. The answer is a general denial, except as to the making of the contract, with allegations of specific violations thereof.
The case was tried by the coprt without a jury. The finding on the first count was for the defendant. On the second count it was for the plaintiffs, on the theory that the defendant having used the wall as a party wall ought to pay one half of the reasonable value of the wall actually used by him at the time it was so used, less one half of the reasonable value of the part of said wall built by defendant at the time it was built; and upon this theory plaintiffs’ damages were assessed at the sum of $4,247.67, and judgment for that amount rendered in his favor, from which the defendant appeals. The contention of the defendant is that a party wall is a solid blank wall without windows or openings therein; that such was the wall contemplated in thé contract, and that by reason of the space aforesaid having been left above the foundation, unbuilt in, such wall was not a party wall within the meaning of the contract, although the contract provided that plaintiffs using it build the wall of such depth as they saw fit, and in all other respects the wall below and on each side of this space was a solid blank wall without windows of openings therein, built in accordance with the requirements of the contract, and subjected by the character of its construction to no exclusive servitude for plaintiffs’ benefit. To this *96extent the contention of the defendant was sustained by the circuit court, by its finding in his favor on the first count of the petition, and that ruling, not being before us for review on his appeal, need not be discussed. The contention, however, goes further, and it is insisted that the work not having been completed in accordance with the tei'ms of the contract as construed by the court, the court committed error in holding that the defendant was liable to the plaintiffs for anything on account thereof, although the same was accepted and used by the defendant for a party wall as contemplated in the contract.
In support of this contention a number of cases are cited in which it has been in effect held that where a wall has been erected by the owner of a lot on the boundary line between his own aud an adjoining lot, resting partly on each, the law imposes no obligation on the owner of the adjacent lot to contribute to the cost of its erection in the absence of an agreement or promise to do so (Preiss v. Parker, 67 Ala. 500, and eases cited; List v. Hornbrook, 2 W. Va. 340; Sherred v. Cisco, 4 Sandf. 480; Orman v. Day, 5 Fla. 385), a general proposition that may be conceded for the purposes of this case. On this principle it is contended that although the wall in this instance was erected in pursuance of a written agreement duly executed, acknowledged and recorded, and in conformity thereto, except in the respect mentioned, and of great value to the defendant for the very use intended in the agreement, and to which use it was subjected, and ever since has been enjoyed by the defendant; yet the wall not having been completed in the manner contemplated in the contract, the consent of the defendant thereby given was forfeited, the plaintiffs became trespassers ab initio and can claim nothing on account thereof, notwithstanding their large expendi*97ture therefor, under the contract, for the defendant’s benefit. This contention wholly ignores that salutary and equitable principle, early introduced into the common law, and which has become firmly imbedded in our system of jurisprudence, that, “If one party, without the fault of the other, fails to perform his side of the contract in such a manner as to sue on it, still, if the other party has derived a benefit from the part performed, it would be unjust to allow him to retain that without paying anything. The law, therefore, generally implies a promise on his part to pay such a remuneration as the benefit conferred is reasonably worth, and to recover that quantum of remuneration, an action of indebitatus assumpsit is maintainable.” Yeats v. Ballentine, 56 Mo. 535, and cases cited. “The established rule extracted and deduced from all the cases is, that where a a party fails to perform his work according to the stipulations of his agreement, he can not recover on the special contract; but if the services rendered by him or the materials furnished, are valuable to the other party, and are accepted by such party, then he would be liable to pay the actual value of the work performed or the materials furnished, not exceeding the contract price, after deducting for any damage which had resulted from a breach of the agreement.” Eyerman v. Mt. Sinai Cemetery Association, 61 Mo. 491. The principle upon which this rule is based is so fair, just and equitable that while at first its application was limited to a certain class of contracts it has now become in this State a rule of general application to all contracts where it can be applied without doing the defendant injustice. Moore v. Gaus Mfg. Co., 113 Mo. 98; Halpin Mfg. Co. v. School District, 54 Mo. App. 371. So far as our decisions go the only exception perhaps thus far developed are contracts for labor for a specified term. Earp v. Tyler, 73 Mo. 617, and cases cited.
*98We fail to discover in the argument of counsel for the defendant, drawn from the nature of the interest acquired by the co-terminous proprietors in a party wall built as this one was, any sound reason for not applying this rule to the case in hand, as was done by the circuit court in its judgment, which ought to be, and is therefore affirmed.
All concur.