This is an action on a building contractor’s bond to recover for lumber and other materials furnished by plaintiff to the contractor for use in the construction of the building on account of which the bond was given. The defendants who are the contractor and his sureties interposed a demurrer to the petition which the court sustained. Plaintiff declined to plead further and appealed from the judgment rendered against it. The material facts alleged in the petition are as follows: The Confederate Soldiers ’ Home near Higginsville is one of the eleemosynary institutions of the state and is under the control of a board of managers appointed by the governor with the advice and consent of the Senate. In 1909 the board entered into a contract with', the defendant contractor (Schwartz) for the building of a ■dormitory at the Home according to the plans and specifications adopted by the board and agreed on the consideration of $7388 for the performance of the contract. The board required a bond of Schwartz to secure the performance of the contract and in compliance with the requirement, Schwartz, as principal, and the other two defendants as sureties, executed and delivered to the board the following undertaking:
*662“Know all men by these presents: That Edward Schwartz, contractor and builder of the city of Jefferson, Missouri, as principal, and J. P. Moerschel, B. Gr. Vieth, as securities, are held and firmly bound unto the board of managers of the Confederate Soldiers’ Home in Higginsville, Missouri, in the sum of five thousand dollars ($5000), for the payment of which we bind ourselves, our heirs, executors and administrators by these presents.
“That condition of the foregoing obligation is such, that whereas, the said Edward Schwartz entered into contract with the said board the 30th day of September, 1909, to build, erect and complete a certain dormitory building on the premises of the Confederate Soldiers’ Home in Higginsville, Missouri, as set forth in the above said contract, and to furnish all the necessary material and labor required by the plans and specifications prepared for the same by Miller & Opel, architects of Jefferson City, Missouri, for the sum of seven thousand three hundred and eighty-eight dollars ($7388).
“Now if the said Edward Schwartz shall well and truly perform his contract with the said board, and shall deliver the work finished throughout according to the plans and specifications, and deliver the work to the owner free from all debts or liens of every character on account of materials furnished or labor performed in and about the said building, then this obligation shall be void; otherwise to remain in full force and effect. Witness our hands this 11th day of October, 1909.
“J. F. Moerschel. “Edw. Schwartz,
Ben Gf. Vieth.” '
Schwartz completéd the building according to the "terms of'his contract and the board accepted it. Plaintiff furnished lumber and other materials to Schwartz for use in the construction of the building and they were so used. But Schwartz failed to pay in full for *663such materials aud is indebted to plaintiff on account thereof in the sum of $826.20. Plaintiff seeks to recover on the bond on the theory that it was taken by the hoard for the benefit of subcontractors, material-men and laborers who should furnish material’ and labor for the building.
The demurrer attacked the petition on three principal grounds: (1) That it does not state a cause of action. (2) Shows on its face that plaintiff in suing in its own name and not as a relator is not a proper party plaintiff. (3) Discloses that Schwartz has fully performed his contract and the obligation of his bond since he had delivered the building free and clear of any debt o,r lien and the board has accepted it.
In 1895, statutes were enacted requiring counties, cities, towns, etc., “to take a bond from all contractors for public work done . . . containing a condition for the payment for all labor done and material furnished fox such woxk and giving laborers and materialmen a right of action thereon.” [Laws 1895, p. 240.]
It was held by the St. Louis Court of Appeals in Brick Co. v. School District, 79 Mo. App. 665, that this statute afforded no cause of action to material-men or laborers against the officers of a municipal corporation for failure to take a bond from a contractor for public work. And doubtless to compel obedience to the law as well as to enlarge its scope the statutes were amended in the revision of 1909' and as amended they make it “the duty of all officials, boards, commissions, commissioners or agents of the state or of any county, city, town, etc., ... to require every contractor for such work to execute a bond to the state, county, city, ... or town . . conditioned for the payment for all material used in such work and for all labor performed in such work whether by subcontractor or otherwise.” [Section 1247, Eevised Statutes 1909.]
*664In the next section the right is given every person furnishing material or performing labor “to sne on such bond in the name of the state . . . for his ■own nse and benefit,” etc. This amendment had become a law before the execution of the bond in suit ■and as the Soldiers Home was a state institution and its board of managers were officers of the state, the statutes to which we have referred imposed the duty on the board to take a bond from the contractor running to the state and conditioned for the payment of all the material and labor used in the construction of the dormitory. Had such statutory bond been taken plaintiff could have maintained an action upon it for the recovery of its demand since the avowed object ■of the statute is the protection of subcontractors, materialmen and laborers to whom the mechanics’ lien law affords no right to a lien against public buildings ■or works. No doubt it was the purpose of the board to obey the law by requiring a bond from the contractor in compliance with the statutes. But such purpose, if it existed, was not accomplished. The bond in suit instead of running to the state was made to the board as obligee and instead of being expressly ■conditioned for the payment of all material and labor used in the work was conditioned first for the completion and delivery of the work according to the plans •and specifications and, second, for the delivery of the work “free from all debts and liens of every character on account of materials furnished or labor performed in and about the said building.”
The instrument is not a statutory bond but we think it is good as a common law bond. A bond though voluntary and not authorized, by any statute is' valid if it does not contravene public policy nor violate any statute. [Barnes v. Webster, 16 Mo. 258.] And it is a well-settled rule that a bond taken by a public officer in attempted compliance with a statute is good as a ■common law bond though it falls short of fulfilling *665the requirements of the statute. [Waterman v. Prank, 21 Mo. 108; State v. Thomas, 17 Mo. 503.] Since thehond was not a statutory obligation and was not executed to the state, plaintiff was not compelled to sue in the name of the state to the use of plaintiff. The only theory on which plaintiff who was not a party to-the bond may recover upon it is that it was executed for his benefit. “A contract between two parties upon a valid consideration may be enforced by a third party when entered into for his benefit. This is so though such third party be not named in the contract and though he was not privy to the consideration. It is. sufficient in order to create the necessary privity that the promisees owe to the party to be benefited some-obligation or duty legal or equitable which would give him a just claim.” [City to use v. Von Phul, 133 Mo. 561; Devers v. Howard, 144 Mo. 671; City of Bethany v. Howard, 149 Mo. 504.] A third person for whose-benefit a contract is made may enforce the contract in an action prosecuted in his own name and in an action on a common law bond of the nature of that in suit a materialman for whose benefit the bond was. taken may sue as plaintiff. [Devers v. Howard, supra; City of Bethany v. Howard, supra.]
The most serious question in -the ease is the. contention of defendants that the bond on its face shows-that it was not made for the benefit of third persons but for the sole benefit of the parties themselves. “If it appear from the contract itself that it was made for •the benefit of the contracting parties therein, and no other, an action by a third party cannot, of course, be maintained thereon.” [Mfg. Co. v. Clark, 208 Mo. 89.]
In our opinion the provisions of the instrument bespeak a mutual intention of the board and the contractor to protect materialmen and laborers who furnished material and labor for the building under con*666tract with, the contractor. The same rules of interpretation apply to bonds as to other contracts.
“Though a surety is regarded as a favorite of the law and the obligation of suretyship in its application to concrete facts is, therefore, considered strictissimi juris, the suretyship contract itself is nevertheless interpreted and construed in accord with the identical rules which obtain with respect to other undertakings.” [Board of Education v. Fidelity Co., 155 Mo. App. 109; Harburg v. Kumpf, 151 Mo. 16.]
The intention of the parties must control the interpretation of the contract and such intention must be gathered from the whole instrument. To hold that the bond in question was not intended for the protection of third persons would be to say that its second clause is meaningless and for all practical uses should be stricken from the instrument. One of the canons of construction is that, if possible, effect must be given to all parts of the instrument. On defendant’s theory, what effect could be given the obligation “to deliver the work . . . free from all debts or liens of every character on account of materials furnished or labor performed?” This being a public building no debts made by the contractor could become a lien or charge on the building or impose any liability on the board. So far as the protection of the building and of the board was concerned those words were superfluous but they were pregnant with meaning if their purpose was to benefit third persons. Manifestly it was the intentio’n of the parties to insert a condition similar to that required by the statute, to compel the contractor to pay for material and labor that entered into the construction. These considerations necessitate the conclusion that the learned trial judge erred in sustaining the demurrer. The judgment is reversed and the cause remanded.
All concur.