
221 N.W.2d 703 (1974)
Irwin JACOBSON, Respondent,
v.
RAUENHORST CORPORATION, Defendant and Third-Party Plaintiff, Respondent,
v.
D. R. SMITH ERECTION COMPANY, Third-Party Defendant, Appellant.
No. 44187.
Supreme Court of Minnesota.
September 20, 1974.
*704 Jardine, Logan & O'Brien, Donald M. Jardine and Margaret M. Marrinan, St. Paul, for appellant.
DeParcq, Anderson, Perl & Hunegs, Minneapolis, for Jacobson.
Meagher, Geer, Markham, Anderson, Adamson, Flaskamp & Brennan and R. M. Frisbee, and O. C. Adamson, II, Minneapolis, for Rauenhorst.
Heard before KNUTSON, C. J., and OTIS, PETERSON, TODD, and SCOTT, JJ., and considered and decided by the court en banc.
OTIS, Justice.
This is a personal injury action resulting from an accident which occurred on October 5, 1971, while plaintiff, Irwin Jacobson, was employed by third-party defendant, D. R. Smith Erection Company, subcontractor on a construction project where defendant, Rauenhorst Corporation, was the principal contractor. Third-party defendant appeals from judgment for defendant granted on the pleadings and from an order denying a motion for vacation of the judgment. We affirm.
Two principal issues are presented: (1) Whether an accident caused by the negligence of the contractor is included in an indemnity agreement between defendant contractor and third-party defendant subcontractor; and (2) whether the subcontractor's answer and counterclaim raised an issue which precludes judgment on the pleadings.
*705 For purposes of this appeal it is assumed that the accident was caused by the negligence of defendant Rauenhorst in constructing a wall on which third-party defendant Smith was to mount beams.[1] At the time of the accident, there was a Standard Subcontract Agreement in effect between Rauenhorst and Smith which included the following waiver clause:
"XXI. If the proper performance of any item of work to be performed hereunder by the Sub-Contractor depends upon the proper performance of any item of work by the Contractor or another sub-contractor whose work precedes in time the work of the Sub-Contractor, to admit by commencing the item of work to be performed hereunder that the work which precedes such item of work to be done hereunder by the Sub-Contractor has been done in a proper manner."
The only other relevant provision was this indemnity clause:
"The Sub-Contractor agrees to assume entire responsibility and liability for all damages or injuries to all persons, whether employees or otherwise, and to all property, arising out of, resulting from or in any manner connected with, the execution of the work provided for in this Sub-Contract or occurring or resulting from the use by the Sub-Contractor, his agents or employers, of materials, equipment, instrumentalities or other property, whether the same be owned by the Contractor, the Sub-Contractor or third parties, and the Sub-Contractor agrees to indemnify and save harmless the Contractor, his agents and employees from all such claims including, without limiting the generality of the foregoing, claims for which the Contractor may be, or may be claimed to be, liable, and legal fees or disbursements paid or incurred to enforce the provisions of this paragraph, and the Sub-Contractor further agrees to obtain, maintain and pay for such general liability insurance coverage as will insure the provisions of this paragraph."[2]
Rauenhorst impleaded Smith after Smith declined Rauenhorst's tender of the defense. Smith counterclaimed contending that the indemnity provision did not apply to accidents caused by the contractor's negligence and that it was entitled to damages for breach of implied warranty. Rauenhorst then moved for judgment on the pleadings, pursuant to Rule 12.03, Rules of Civil Procedure. The court granted the motion.
1. Smith argues that the indemnity clause does not protect the contractor from his own negligence and that defendant's breach of implied warranty of fitness in constructing the wall nullifies the indemnity provisions. We do not agree. We recently held in Christy v. Menasha Corp., 297 Minn. 334, 211 N.W.2d 773 (1973), that where injuries are caused by the contractor's negligence, the indemnity provisions of the Standard Subcontract Agreement apply to injuries suffered by an employee of the subcontractor. The Christy case involved the same indemnity clause and here controls. "* * * [M]erely because the damage results from the indemnitee's own negligence does not prevent recovery on an express contract which is broad enough to include such damages." 297 Minn. 341, 211 N.W.2d 777.
*706 Nor may the indemnity provision be avoided because defendant breached an implied warranty where there is a specific agreement regarding the risk of loss or the liability for injuries.[3] Moreover, Smith waived any objection to Rauenhorst's preparatory work by the terms of Clause XXI, Standard Subcontract Agreement, quoted above.
2. Smith argues that a motion for judgment on the pleadings may not be granted where there is a counterclaim or an affirmative defense interposed, citing Cummings v. Taylor, 21 Minn. 366 (1874); and State v. Schurz, 143 Minn. 218, 173 N.W. 408 (1919). However, those cases simply hold that judgment on the pleadings is improper where a counterclaim raises material issues of fact.
Judgment on the pleadings is proper where the defendant relies on an affirmative defense or counterclaim which does not raise material issues of fact. Greaton v. Enich, 290 Minn. 74, 77, 185 N.W.2d 876, 878 (1971); Minneapolis St. Ry. Co. v. City of Minneapolis, 229 Minn. 502, 515, 40 N.W.2d 353, 362 (1949), appeal dismissed, 339 U.S. 907, 70 S.Ct. 574, 94 L.Ed. 1335 (1950); 1 Hetland & Adamson, Minnesota Practice, Civil Rules Ann., Authors' Comments to Rule 12.03, p. 455. See, also, O'Brien v. Kemper, 276 Minn. 202, 149 N.W.2d 487 (1967). Viewing the evidence in a light most favorable to third-party defendant, as we must, it is assumed that defendant's negligence caused plaintiff's injury. Appellant Smith's answer and counterclaim admit the allegations of Rauenhorst's third-party complaint except paragraph VIII, which consists of a conclusion of law that Rauenhorst is entitled to be held harmless and to be indemnified for its liability. This does not preclude judgment on the pleadings. Mahne v. American Fraternal Union, 216 Minn. 303, 304, 12 N.W.2d 615, 616 (1943).
The question of an implied warranty is not one of fact but one of law. Although the trial court did not expressly address itself to the warranty issue, in granting judgment for defendant it thereby disposed of that issue. Where a subcontractor has expressly agreed to secure liability insurance to protect the general contractor from claims by the subcontractor's employees, a warranty will not be implied which relieves the subcontractor from performing that agreement. Neither will such a warranty support a counterclaim where the measure of damages relates only to injuries sustained by the subcontractor's employee and to liability of the subcontractor because of the indemnity agreement.
Affirmed.
SHERAN, C. J., not having been a member of this court at the time of the argument and submission, took no part in the consideration or decision of this case.
NOTES
[1]  Defendant Rauenhorst Corporation, the principal contractor, had acted as architect and furnished the plans and specifications for this project. It performed some work before Smith began construction, including erection of a wall on which Smith was to mount beams. The wall in question, instead of being 14 inches wide, as called for in the plans, was 12 inches wide and there were only two bolts to support the beams rather than the four bolts called for in the plans. Finally, the bolt which was embedded in the cement to which the beam was to be attached was an 8-inch bolt without a hook instead of a 12-inch bolt with a 2-inch hook.
[2]  Second paragraph of Clause VII of Standard Subcontract Agreement of August 18, 1971.
[3]  In Crabb v. Swindler, Administratrix, 184 Kan. 501, 505, 337 P.2d 986, 989 (1959), one of the principal cases relied on by Smith, the following rule was stated: "* * * [I]t is generally recognized that when a party binds himself by contract to do a work or perform a service, in the absence of express agreement, there is an implied agreement or warranty, which the law annexes to the contract, that he will do a workmanlike job and will use reasonable and appropriate care and skill." (Italics supplied.)
