The complaint alleges the following facts, to wit: That in May, 1900, O. A. Braseth & Co., contractors, entered into' a Contract with the defendant, by which that firm agreed to furnish all the materials for and erect a certain two-story bank building for said' defendant for the sum of $2,918. The lumber and some other of the materials used in said building were purchased by said Braseth & Co', from the plaintiff at the agreed price, and were of the value of $631.72, and the defendant, “during all of said time * * * knew, was apprised of, and had full knowledge of the fact that the plaintiff * * * was furnishing the lumber and other building materials to the said Braseth & Co. * * * for use in and about the construction of the said defendants said building;” that said Braseth & Co. has not paid said sum to the plaintiff, nor has the defendant paid said sum to the *514plaintiff; that on December 15, 1902, the plaintiff caused a claim 'for a lien against said building to be filed in the office of the clerk of the district court, which said claim for a lien contained a statement of all the facts necessary to be stated therein; that prior to the filing of said lien the plaintiff had notified the defendant by registered letter that it had furnished said materials to said Braseth & 'Co. The plaintiff demands a foreclosure of its lien, and the sale of said building to satisfy said lien, with costs. The defendant demurred to the complaint on the ground that it fails to state facts sufficient to set forth a cause of action against the defendant bank. The trial court overruled the demurrer, and defendant appeals from the order overruling it.
The defendant advances two grounds upon which it claims that the demurrer should be sustained: (1) That it fails to show that the defendant owes Braseth & Co. any money by virtue of the contract; (2) that the notice alleged to have been given to the defendant of the furnishing of the materials for the building is not properly pleaded.
It will be seen that Braseth & Co. were the contractors for the erection of the building under contract with the defendant, the owner. The plaintiff furnished materials for the building under contract with Braseth & Co., and was a subcontractor, under the provisions of the statute. Section 4800, Rev. Codes. The lien was not filed by the plaintiff until more than two years after the materials were furnished. The rights of subcontractors under liens filed under such circumstances are involved in the appeal. The defendant contends that subcontractors are not entitled to a direct lien for materials furnished, and cannot claim a lien, under the circumstances of this case, without alleging and proving that the defendant has money in its hand’s belonging to Braseth & Co. under the contract.
The statutes which control a decision -in this case are as follows: Section 4788, Rev. Codes 1899, provides that “an}'- person who shall perform any labor or furnish any materials * * * for the erecting * * * of any * * * buildings * * * upon land * * * under contract with the owner of such land, his agent, * * * contractor or subcontractor, or with the consent of such owner, shall, upon complying with- the provisions of this chapter, have, for his labor done or materials * * * furnished, a lien upon such building * * * and the land belonging to such owner * * * to secure the payment. * * * The *515owner shall -be presumed' to have consented to * * * the making of any such improvement if at the time he had knowledge thereof and did not give notice of his objection thereto to the person entitled to the lien.” Section 4791, Rev. Codes 1899, provides that all -claims for liens under the provisions of -the -chapter -on mechanics’ liens shall be filed in the office of the clerk of ,the district cou-r-t within ninety days a-fter the materials have been furnished; '‘but a failure to file the same within the time aforesaid shall not defeat -the lien, -except as against pur-chasers or incumbrancers -in good faith and for value, whose -rights accrue after the ninety days and before any -claim for the lien is filed, or as -again-st the owner except the amount paid to the contractor after the expiration of the ninety days and before the filing of the same.”
The -contention of the appellant is that these provisions do- not directly and positively authorize a lien in favor of a subcontractor. The contention is tha-t a subcontractor has only a conditional right to -a lien, depending upon the fact whether there is money in the owner’s hand due to the contractor when the lien is filed; in -other words, -that the subcontractor is entitled to a lien by -subrogation only. We cannot agree w-ith this construction of the statute. The language is plain that a 'subcontractor has a lien if he has furnished materials or done w-ork on a bu-ilding an-d files his claim therefor. The filing of it within ninety -days after -the materials are furnished makes the lien -effective as again-st every one acquiring rights in the land or building. If filed after said ninety days, the lien is -still preserved intact, except as to -those in good faith acquiring rights to the property after the ninety -days an-d before the lien is filed. The lien still remains as against the owner, except as to payments made to the contractor after .the ninety -days had expired an-d before the lien is filed. To construe these provisions as giving a lien by subrogation only would be to read into the statute what was not placed there, nor intended t-o be placed there, by the legislature. Giving -to the language of these -sections th-eir plain meaning, they give to a -subcontractor a lien without regard- to the state of the account between the contractor and the owner. The owner must keep advis-ed as to whether the materials used in his building are paid for or not, an-d if he pays the contractor -during the ninety -days after the materials are furnished-, or thereafter, after a lien is filed, he does so at his peril. In other words, subcontractors are protected by the statute. This i-s .not a hardship upon the owner. He can -easily secure himself against the failure of contractors to *516meet their obligations with those who furnish materials for or work on the building. However, we have nothing -to do with the policy of the statute. That rests with the legislature. It ha-s seen proper to protect subcontractors as against contractors in certain contingencies. It has adopted what is known, as the “Pennsylvania system,” as against the “New York system.” Phillips on Mechanics’ Liens, section 57; Boisot on Mechanics’ Liens, section 225; Hunter v. Truckee Lodge, 14 Nev. 24; Colter v. Frese, 45 Ind. 96; Albright v. Smith, 3 S. D. 631, 54 N. W. 816; Laird v. Moonan, 32 Minn, 358, 20 N. W. 354; Spokane Lumber Co. v. McChesney, 1 Wash. St. 609, 21 Pac. 198; Merrigan v. English, 9 Mont. 113, 22 Pac. 454, 5 L. R. A. 837.
The appellant urges that the demurrer should be sustained for the reason that the complaint fails to show that the defendant, as owner of the building, has any money in its hands due to the contractors under the contract. The authorities that hold that a subcontractor has- not a direct lien on the building seem to sustain such contention. Those authorities that construe the statutes to give a 'direct lien in favor of subcontractors hold such an allegation unnecessary. In the latter cases these facts are held to be matters of -defense to be raised by answer. A defense of payment is an affirmative defense to be raised by answer. Such an allegation is not part of the cause of action for the foreclosure of a lien. This complaint'sets forth all facts necessary to the creation of a lien, and that is sufficient. It is not necessary to negative the possible defense of payment. That is a fact resting within the knowledge of the defendant. If payments were made by the defendant between the expiration of the ninety days after the materials were furnished and the time of the filing of the lien after the ninety days had expired, it should be alleged as a defense, and need not be negatived by an allegation in the complaint. As stated by the court in Hunter v. Truckee Lodge, supra: “Our opinion is that it was the intention of the legislature to give the material-men and subcontractors claiming liens under the law the benefit of a presumption that contracts made with the original contractor were authorized by the owner of the premises; and if, under the statute or under the constitution, it is -a good defense for the owner to show that he has paid in good faith and in pursuance of his contract all that he agreed -to pay before notice of the claims of third persons-, he is bound to allege and prove the fact.” Phillips on Mechanics’ Liens (2d Ed.) section 294; Bois'ot on Mechanics’ *517Liens, section 634. . This is in harmony with the general rule of pleading, applicable to action on, mechanics’ liens as well as to others of a similar-nature. Boisot on Mechanics’ Liens, section 534; Doughty v. Devlin, 1 E. D. Smith (N. Y.) 625.
(105 N. W. 719.)The defendant further urges that the allegation of the complaint, to wit, “that prior to the filing of said lien the plaintiff had notified the defendant by registered letter that it had furnished said materials to said- A. O. Braseth & Co.,” is the pleading of a conclusion only, and therefore cannot be sustained as against -a demurrer. The statute provides that the subcontractor shall not be “entitled to file such lien unless he notify the owner of the land by registered letter previous to the completion of said contract that he has furnished said materials.” Section 4788, Rev. Codes 1899. The complaint also alleges that the contract ha-s not yet been completed. We hold the fact of the giving of the notice properly pleaded by such allegation. The words “said materials” refer to the materials previously described -in the complaint. The complaint describes the materials furnished as consisting of lime, .cement, lumber, brick, tiling, sash, doors, windows, carpet felt, moulding, etc. The price and value are given, as well as the time when furnished. Conceding the giving of such notice to be an essential allegation to the cause of action, we have no .hesitation in holding -that it pleads the necessary facts -specifically, and not by statements of conclusions merely.
The question of the constitutionality of the statute granting direct liens to subcontractors as -construed by us has not been argued, nor is its unconstituti-o-nality seriously urged upon us. We will therefore not discuss the question, but will cite some of the cases holding such laws constitutional. Spokane Manufacturing & Lumber Co. v. McChesney, supra; Albright v. Smith, supra; Laird v. Moonan, supra; Boisot on Mechanics’ Liens, section 23, and cases cited.
Order affirmed.'
All concur.