This is an appeal from a decision of the district court denying a request for an award of attorney fees under Idaho Code § 54-1929. We affirm the district court.
I. FACTS AND PROCEDURAL HISTORY
In the fall of 2000, the Ada County Highway District awarded Park Towne Construction, Inc., (Park Towne) a contract to replace three small bridges in Ada County. Park Towne subcontracted with Oldcastle Precast, Inc., (Oldcastle) to provide precast concrete box culverts to be used in the construction project. After Oldcastle had completed its obligations under the subcontract, Park Towne refused to pay the balance owing. Prior to being awarded the contract, Park Towne had obtained a payment bond from Developers Surety and Indemnity Company, (Developers Surety) as required by Idaho Code § 54-1926. On September 7, 2001, Oldcastle filed a lawsuit against Park Towne and Developers Surety to recover the amount, plus interest, still unpaid under its subcontract. The Defendants answered denying liability, and Park Towne filed a counterclaim seeking damages against Oldcastle for breach of the subcontract.
The case was set for a court trial to commence on April 17, 2003. On the morning of the first day of the trial, Developers Surety paid Oldcastle the principal and interest owing under the subcontract. Oldcastle’s counsel admitted it no longer had a cause of action against Developers Surety, and the trial then proceeded on Park Towne’s counterclaim, with only Park Towne and Oldcastle participating. The district court found in favor of Oldcastle on the counterclaim.
The district court awarded Oldcastle attorney fees against Developers Surety and Park Towne up to the date of trial pursuant to Idaho Code § 54-1929. It refused to award Oldcastle attorney fees under that statute for successfully defending against Park Towne’s counterclaim. Oldcastle then appealed.
II. ANALYSIS
Idaho Code § 54-1929 provides, “In any action brought upon either of the bonds provided herein, 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 issue is whether, once Oldcastle had been paid all sums owing under the subcontract, this continued to be an action brought upon the bond. We hold that it did not.
Idaho Code § 54-1926 requires public works contractors to furnish a performance bond and a payment bond. The performance bond is “solely for the protection of the public body awarding the contract.” I.C. § 54-1926(1). The payment bond is “solely for the protection of persons supplying labor or materials, or renting, leasing or otherwise supplying equipment to the contractor or subcontractors in the prosecution of the work provided for in such contract.” I.C. § 54-1926(2). If a person who provided labor or material or supplied equipment is not paid within the time specified in Idaho Code § 54-1927, such person may sue on the payment bond “for the amount, or the balance thereof, unpaid at the time of institution of such suit.” I.C. § 54-1927.
In this case, Oldcastle filed a lawsuit seeking to recover the amounts owing under the subcontract, and Park Towne filed a counterclaim for breach of contract. On April 17, 2003, Developers Surety paid Old-castle the unpaid balance owing to Oldcastle under its subcontract with Pai’k Towne, plus interest. Once that sum was paid, there was no further liability under the payment bond. A payment bond does not protect against all *378disputes between a contractor and subcontractor. Beco Constr. Co., Inc. v. City of Idaho Falls, 124 Idaho 859, 865 P.2d 950 (1993) (a payment bond does not protect against the time and expense of attempting to correct or seek a remedy for defective work). The payment bond required by Idaho Code § 54-1926(2) only protected Oldcastle against nonpayment of sums due under its subcontract.
Once Developers Surety had paid all sums owing under the subcontract, this ceased to be an action brought upon the bond because Developers Surety had no further liability under the bond. It became solely an action on Park Towne’s counterclaim for breach of contract. Oldeastle’s counsel admitted that, once payment had been made, Oldcastle no longer had a cause of action against Developers Surety, and Developers Surety did not participate in the trial on Park Towne’s counterclaim.
Idaho Code § 54-1929 creates a statutory duty to pay attorney fees to the prevailing party in actions brought under either the performance bond or the payment bond. The district court properly awarded Oldcastle attorney fees incurred by it up to the date it was paid all sums due under the bond. The attorney fees incurred by Oldcastle after it had been paid in full were not incurred in an action under the performance bond. Therefore, the district court correctly held that Oldcastle was not entitled to attorney fees under Idaho Code § 54-1929 for successfully defending against Park Towne’s counterclaim for breach of contract. Oldcastle would have been entitled to an award of attorney fees under Idaho Code § 12-120(3) for successfully defending against the counterclaim, Iron Eagle Development, LLC v. Quality Design Systems, Inc., 138 Idaho 487, 65 P.3d 509 (2003); Ervin Constr. Co. v. Van Orden, 125 Idaho 695, 874 P.2d 506 (1993), but it did not request attorney fees under that statute.
The dissent relies upon the reasoning in First General Services v. Perkins, 918 P.2d 480 (Utah Ct.App.1996), to argue that Idaho Code § 54-1929 should be construed in this case to provide for the awarding of attorney fees to Oldcastle for successfully defending against Park Towne’s counterclaim. There is a significant difference between this case and that one. In this case, prior to the trial Developers Surety paid Oldcastle in full all sums due under the payment bond and did not participate in the trial. At that point, this ceased to be an action upon the bond. Oldcastle’s counsel conceded to the district court that Oldcastle no longer had a claim against Developers Surety. In the Utah case, the hen claimants were not paid in full, and the landowner whose property was subject to the mechanics’ liens participated throughout the trial in an unsuccessful attempt to keep the lien claimants from being paid. Had Oldcastle not been paid in full prior to the trial, then the entire litigation would have been an action on the bond because it would have been required to prevail on the counterclaim in order to receive payment under the bond. That is not what happened in this case, however.
Because Developers .Surety had already paid Oldcastle in full, the only issue tried in this case was whether Park Towne was entitled to recover damages against Oldcastle for breach of contract. That would be an action on the payment bond only if either party were attempting to recover sums that Developers Surety was obligated to pay under its payment bond. Neither party was. Developers Surety had no obligation to pay either party further sums under the payment bond regardless of who prevailed on the counterclaim. Idaho Code § 54-1927 provides that a person furnishing labor or material under a public works construction contract “shall have the right to sue on such payment bond for the amount, or the balance thereof, unpaid at the time of institution of such suit.” Prior to trial, Developers Surety paid Oldcastle all sums “unpaid at the time of institution of such suit,” plus interest. Therefore, the litigation on the counterclaim was not an action on the payment bond, nor was it an action seeking to keep Developers Surety from having to pay any sums due under the payment bond.
In support of its position, the dissent states, “Developers Surety was in a better position than Oldcastle to discourage Park Towne from pursuing its counterclaim, which *379turned out to be without merit.” There is absolutely nothing in the record supporting this factual finding, nor does the dissent explain how Developers Surety could have prevented Park Towne from pursuing its counterclaim. The dissent also states that the defense against Park Towne’s counterclaim, “if successful, would reduce Oldcastle’s recovery for its work and inure to the benefit of the surety.” Again, there is nothing in the record to support that assertion. Developers Surety had already unconditionally paid Old-castle in full, so the outcome of Park Towne’s counterclaim could not lessen the amount of money that Developers Surety was required to pay Oldcastle under the payment bond. Developers Surety had not asserted any claim against Oldcastle, and so it could not recover any money back from Oldcastle. If Park Towne recovered damages from Oldcastle, that would only benefit Park Towne.
Both parties also request an award of attorney fees on appeal. Oldcastle requests attorney fees under Idaho Code § 54-1929. Because Oldcastle is not the prevailing party and this is not an appeal from a judgment upon the payment bond, Oldcastle is not entitled to an award of attorney fees under that statute.
Developers Surety seeks an award of attorney fees pursuant to Idaho Code § 12-121. Attorney fees could be awarded against Oldcastle under that statute only if it brought or pursued the appeal frivolously, unreasonably, or without foundation. BHA Invs., Inc. v. City of Boise, 141 Idaho 168, 108 P.3d 315 (2004). The legal issue raised by Oldcastle was a matter of first impression, and it therefore did not bring or pursue this appeal frivolously, unreasonably, or without foundation. KMST, LLC v. County of Ada, 138 Idaho 577, 67 P.3d 56 (2003).
III. CONCLUSION
The judgment of the district court is affirmed. We award costs on appeal, but not attorney fees, to Developers Surety.
Justices TROUT and BURDICK concur.