This is an appeal from a judgment sustaining a demurrer to the amended complaint. The parties own adjoining lots of land in the city of San Francisco. The plaintiff was about to excavate for the purpose of building. Upon defendant’s lot is a brick building. Plaintiff, in accordance with the requirements of section 832 of the Civil Code, notified defendant of his intention to excavate for the purpose of laying the foundation of his building. Defendant neglected to take any action toward the protection of his property from the danger arising from such excavation, and plaintiff, in order to prevent said building from falling in and upon his lot, was compelled to expend fourteen hundred dollars in the support of' the adjacent walls of defendant’s lot, which would not have been necessary had it not been for defendant’s building. The action is brought to recover the amount of money thus expended. Section 832 of the Civil Code is as follows: —
“Each coterminous owner is entitled to the lateral and subjacent support which his land receives from the adjoining land, subject to the right of the owner of the adjoining land to make proper and usual excavations on the same for purposes of construction, on using ordinary care and skill, and taking reasonable precautions to sustain the land of the other, and giving previous reasonable notice to the other of his intention to make such excavations.”
If plaintiff’s acts have created a liability against defendant to the extent of fourteen hundred dollars, it must be upon an obligation arising upon contract or from some character of tort. There is nothing in the com*99plaint indicating anything in the nature of a contract between these parties, and no tort is shown, unless defendant has violated some provision of the section just quoted; but the service of the notice as required by that section did not cast any duty upon the defendant, for neglect in the performance of which a liability could be created in favor of the plaintiff. The purpose of the notice required was to give the adjacent land-owner an opportunity to protect his property from possible damage if he so desired; if he did not so desire, or was willing to assume the risk brought about by the threatened excavation, then, if dire results to his property should follow, the liability for such results would lie at his own door. The purpose of the section, in its broadest scope, was to enable the excavator to relieve himself from liability, not to create a liability in favor of himself, upon the adjacent owner.
It clearly appears that plaintiff expended this money for his own benefit and his own advantage, and not for the benefit and use of the defendant. A party cannot of his own volition create an obligation in his own favor by doing some act for his own interests, and the necessity for which was caused by himself. This is in no sense an action brought for the' recovery of money advanced for and to the use of defendant. No legal duty rested upon the defendant to perform the work for which this money was expended, and plaintiff cannot create for himself the position of creditor against the will of the alleged debtor.
It is unnecessary to pass upon other matters discussed in appellant’s brief.
Let the judgment be affirmed,
Harrison, J., and Paterson, J., concurred.