dissenting.
Because the counterclaim Park Towne unsuccessfully pursued against Oldcastle was related directly to the subcontract work that Oldcastle was seeking to recover for when this suit was initiated, I believe that Idaho Code § 54-1929 must be construed to allow attorney fees for successfully defeating the counterclaim. To hold otherwise would impair the rights afforded to mechanics, laborers, and materialmen under the laws of Idaho.
Idaho has a strong tradition of supporting the right of laborers and materialmen to obtain payment for their work and materials. Indeed, the Idaho Constitution provides that, “The legislature shall provide by proper legislation for giving to mechanics, laborers, and material men an adequate lien on the subject matter of their labor.” § 6, Art. XIII, Idaho Constitution. In compliance with this provision, the Legislature enacted legislation in 1893 providing for a lien in favor of mechanics, laborers, and materialmen against the property for which they furnished their labor or materials in order to secure payment for the same. 1893 Session Laws, pp. 49-54. Section 2 of the enactment provided that subcontractors, laborers, and other persons could hen the public works of any county, city, town or school district. Section 12 of the enactment contained an attorney fee provision, which is identical to the current such provision in the mechanics’ hen law. Idaho Code § 45-513. In 1909, the Legislature enacted a pubhc works bonding provision, which is the predecessor of Idaho Code §§ 54-1925, et seq. That provision subsequently became Idaho Code § 45-502, which was repealed in 1965 concurrent with the enactment of the current pubhc works bonding scheme. 1965 Session Laws, ch. 28. The 1909 bonding provision “was taken almost bodily from the [Miller] act [40 U.S.C. § 270] ...” People v. Storm, 49 Idaho 246, 253, 287 P. 689, 691 (1930).
This Court declared a rewrite of Section 2 of the 1893 enactment to be unconstitutional in 1928, holding the liening of pubhc buildings to be violative of the debt limitation provisions in Sections 3 and 4 of Art. VIII of the Idaho Constitution. Boise-Payette Co. *380v. School Dist. No. 1, 46 Idaho 403, 268 P. 26 (1928). Thereafter, the only statutory protection for laborers and materialmen for labor and materials furnished for the construction of public works was the bonding provision contained in subsequent versions of the 1909 enactment. People v. Storm, 49 Idaho at 253, 287 P. at 691.
This brief history is provided to show that the mechanics’ lien law and public works bonding law were born of common parentage. Both were enacted shortly after statehood to carry out the constitutional responsibility of the Legislature to provide for the protection of laborers and materialmen. The attorney fee provisions — I.C. § 45-413 and I.C. § 54-1929 — should be interpreted and applied in a similar fashion, at least at the trial court level. Indeed, the latter section should probably tilt even more in favor of laborers and materialmen because of its Miller Act history. In City of Weippe v. Yarno, 96 Idaho 319, 321, 528 P.2d 201, 203 (1974), this Court, after noting the parallel between the federal Miller Act and Idaho’s public works bonding provisions, stated:
In People v. Storm, 49 Idaho 246, 254, 287 P. 689 (1930), this Court stated:
The Federal statute, from which our is taken, has been held to be highly remedial, and should, therefore, be liberally construed to cover all persons who supply labor or material in a public work, to give all creditors a remedy on the bond of the contractor to be enforced within the time stated, etc., and that the strict letter of the act must ‘yield to its evident spirit and purpose, when this is necessary to give effect to the intent of Congress.’
See, also, Minidoka County v. Krieger, 88 Idaho 395, 407, 399 P.2d 962, 969 (1965) (laws like former I.C. § 45-502 are highly remedial and are to be construed liberally in favor of labor and materialmen to effectuate their purpose).
Both I.C. § 54-1929 and § 45-513 provide for a mandatory award of attorney fees to a laborer or materialman who prevails on a claim for labor or materials. I.C. § 54-1929 provides:
In any action brought upon either [the performance bond or the payment bond], or against the public body failing to obtain the delivery of the payment bond, the prevailing party, upon each separate cause of action, shall recover a reasonable attorney’s fee to be taxed as costs.
The separate cause of action language is likely to cover the situation where multiple actions are involved — an action on the payment bond, and/or an action on the performance bond, and/or an action against a public body that fails to obtain a payment bond.
Idaho Code § 45-513 provides that “[t]he court shall also allow as part of the costs the moneys paid for filing and recording the claim, and reasonable attorney’s fees.” An award of fees is mandatory upon a successful foreclosure, the rationale being that fees are incidental to the foreclosure of the lien and are merged with and become part of the principal debt on which foreclosure is sought. Electrical Wholesale Supply Co. v. Nielson, 136 Idaho 814, 823-24, 41 P.3d 242, 251-52 (citing Smith v. Faris-Kesl Constr. Co., Ltd., 27 Idaho 407, 423, 150 P. 25, 30 (1915)). Similarly, in “an action on a contractor’s bond attorney’s fees are merely an incident of the judgment and not a separate cause of action.” City of Weippe v. Yarno, 94 Idaho 257, 259, 486 P.2d 268, 270 (1971).
While no Idaho case has discussed whether a party who succeeds in foreclosing on a lien or in suing on a public works contractor’s bond may also recover fees for successfully defending a counterclaim, the Utah Court of Appeals has held that a subcontractor may recover fees where the counterclaim is sufficiently tied to the hen. Utah Code Ann. § 38-1-18 provides: “In any action brought to enforce any lien under this chapter the successful party shall be entitled to recover a reasonable attorneys’ fee, to be fixed by the court, which shah be taxed as costs in the action.” In First Gen. Servs. v. Perkins, 918 P.2d 480 (Utah Ct.App.1996), a subcontractor sued the contractor and landowner for work it had performed, both to foreclose on the lien and for breach of contract. 918 P.2d at 483. The landowner counterclaimed for breach of contract, fraud, negligent misrepresentation, slander of title, conversion, unjust *381enrichment, and constructive trust. Id. The trial court entered judgment for the plaintiff but refused to award fees under Utah’s mechanics’ lien attorney fee statute for the successful defense of the counterclaims. Id. On appeal, the landowner urged the court to construe the statute narrowly and limit fees to those incurred in prosecuting or defending the lien claim. Id. at 486. The court declined to do so in light of “the general policy of Utah courts ... to construe the statutes broadly to protect those who enhance the value of property by supplying labor or materials.” Id. Rather, the court held that:
the successful defense of counterclaims which would otherwise defeat the principal lien claim, in whole or in part, must necessarily be considered for the purpose of awarding attorney fees under the mechanics’ lien statute. Logically, a lien holder must defend against such claims in order to “enforce” the lien. Nevertheless, the principal claim and counterclaims must be sufficiently tied together so that the right to enforce the lien would be defeated or diminished by the counterclaim. Counterclaims completely separate from the hen claim, which merely seek to offset amounts recoverable through enforcement of a mechanics’ lien, would not qualify.
Id. Thus, where the counterclaims were “sufficiently tied to enforcement of the lien,” fees incurred in defending those counterclaims were allowed. Id. at 487.
The rationale articulated by the Utah Court of Appeals is sound. An important factor in the court’s decision was its determination that an action “brought to enforce any lien”, within the contemplation of the fee statute, included a counterclaim that would defeat or diminish the claimant’s recovery for his work or materials. Id. at 486. Here, rather than being an action brought upon the lien, we have an “action brought upon” the bond. I.C. § 54-1929. All three of the claims asserted in the counterclaim were designed to defeat or diminish Oldcastle’s claim for work under the subcontract. They were compulsory counterclaims, arising out of the transaction that was the subject matter of
Oldcastle’s claim. Idaho R. Civ. P. 13(a). Oldcastle could hardly find comfort in the result obtained in district court — it established its entire claim and defeated the three claims asserted by Park Towne in the counterclaim but ended up worse off financially than if it had just dropped the whole matter in the first place. This result is not in keeping with the intent of Art. XIII, § 6, nor in keeping with the highly remedial intent and spirit of Idaho’s version of the Miller Act.
Some scant Idaho precedent does exist to support the result I would adopt.1 This Court has held that a claim for attorney fees may be denied in a lien foreclosure action where a counterclaim results in a complete setoff of a materialman’s claim for materials. Dawson v. Eldredge, 89 Idaho 402, 409, 405 P.2d 754, 758 (1965). Consistent with Dawson, the Idaho Court of Appeals has held that where the lien claimant only partially prevailed, having his recovery reduced by a counterclaim alleging damages as a result of defects in the work, the district court “may, in the exercise of its discretion, fashion the amount of the award to reflect the fact that [the claimant] did not collect the entire amount of the contract and the [property owners] were awarded damages for the defects in the work performed.” Olsen v. Rowe, 125 Idaho 686, 689, 873 P.2d 1340, 1343 (Ct.App.1994). Following this same line of logic, a lien claimant should get a larger award of fees where he has not only established his full claim but also defeated counterclaims alleging deficient performance.
Such a rule is not unfair to the surety furnishing the bond. One could anticipate such a result based upon the constitutional and statutory policy in favor of allowing laborers and workmen to obtain payment for their work. In this case, Developers Surety was aware that Oldcastle wished to recover attorney fees on the bond for its defense of the counterclaim. While Oldcastle’s counsel noted prior to trial, and after receiving payment of the balance of the subcontract, that it had no remaining cause of action against Developers Surety, he did advise the court that Oldcastle would be seeking attorney fees *382incurred in defending Park Towne’s counterclaim. The trial court recited, “[Oldcastle’s] counsel did not object to Developer’s being excused from further attendance at trial, so long as [Oldcastle] could still pursue attorney fees and costs, including those fees incurred in trying the case.” Developers Surety made a conscious choice to forego attendance at the trial.
Developers Surety was in a better position than Oldcastle to discourage Park Towne from pursuing its counterclaim, which turned out to be without merit. Instead of doing so, Developers Surety withdrew from the litigation, allowing Park Towne to run up Oldcastle’s considerable expense for successfully defending against claims designed to take away the money that Developers Surety had paid before trial. Developers Surety claims it should be immunized from liability for Old-castle’s attorney fees incurred in defending against counterclaims which, if successful, would reduce Oldcastle’s recovery for its work and inure to the benefit of the surety. This is not the type of result contemplated by the applicable constitutional and statutory protections for those who furnish labor and materials.
I would not only reverse and remand with instructions to the trial court to award fees for Oldcastle’s successful defense of the counterclaim but also award fees to Oldcastle on appeal. In this regard, it appears that the Legislature provided for a departure from the manner in which attorney fees on appeal are handled, i.e. denied, in actions under the mechanics’ lien law. Up until the 1965 legislative change, public works bonding eases were subject to the same attorney fee provision as that which applied to mechanics’ lien cases. The 1965 legislation, which produced I.C. § 54-1929, utilized a different selection of wording, which is significant.
Attorney fees have been consistently denied on appeal to successful hen claimants based upon a quaint 1936 case, Hendrix v. Gold Ridge Mines, Inc., 56 Idaho 326, 54 P.2d 254 (1936). The Hendrix decision has been followed ever since. The rationale of the decision was succinctly described in Weber v. Eastern Idaho Packing Corporation, 94 Idaho 694, 698, 496 P.2d 693 (1972), as follows:
This Court in Hendrix v. Gold Ridge Mines, Inc.....held that what is now I.C. § 45-513 did not permit recovery of attorney fees on appeal for the lien claimants. The Court reasoned that this particular statute was adopted from the California hen statutes which expressly provided for attorney fees in the supreme court but since that proviso was deleted in the Idaho statute the intent of the legislature was to disallow attorney fees on appeal.
The Weber court further supported the Hendrix rule by determining that “the court”, as used in Section 45-513, was “in a context where the meaning is the ‘trial court.’ ” If the Weber court had examined the language in I.C. § 12-121 — “the judge may award reasonable attorney’s fees to the prevailing party”- — that provision may well have received a different interpretation as to whether or not fees were permitted on appeal. Nevertheless, when the Legislature enacted I.C. § 54-1929, it did not have the same history as § 45-513, nor was the same or similar wording used. Rather, § 54-1929 provides that “[i]n any action” brought on the bond, the prevailing party shall recover a reasonable attorney’s fee. There is no reference to “judge” or “court” so as to limit fees at any stage of the proceeding.
As a matter of fact, this Court has awarded fees on appeal under I.C. § 54-1929 on a number of occasions. City of Weippe v. Yarno, 96 Idaho 319, 528 P.2d 201 (1974); Consolidated Concrete v. Empire West Const., 100 Idaho 234, 596 P.2d 106 (1979); H-K Contractors, Inc. v. City of Firth, 101 Idaho 224, 611 P.2d 1009 (1979). The Idaho Court of Appeals has held otherwise, apparently overlooking this Court’s decisions and understandably concluding that since fees are not awarded on appeal under Section 45-513 the Court should decline “[b]y parity of reasoning” to award fees on appeal under Section 54-1929. Eimco Div., Envirotech v. United Pacific, 109 Idaho 762, 765, 710 P.2d 672, 675 (Ct.App.1985). However, the Court of Appeals did not examine the different histories of these two provisions, nor the difference in the language employed by the Legislature. *383Thus, I would overrule the Court of Appeals’ contrary holding in Eimco Div., Envirotech and hold that I.C. § 54-1929 requires an award of attorney fees to the successful party on appeal.
I dissent for the foregoing reasons. I would award attorney fees on appeal to Old-castle, reverse the district court’s denial of fees for defending the counterclaim at trial, and remand for consideration and assessment of an appropriate fee.
Chief Justice SCHROEDER concurs.. Beco Constr. Co., Inc. v. City of Idaho Falls, 124 Idaho 859, 865 P.2d 950 (1993) has no bearing on the attorney fee issue. That case involved a bid dispute.