
497 P.2d 312 (1972)
OWEN JONES & SONS, INC., formerly Jones Enterprises, Inc., and Empire Western Ltd., formerly Western Ltd., d/b/a Jones-Western, a joint venture, Appellants,
v.
C.R. LEWIS COMPANY, Inc., Appellee.
No. 1460.
Supreme Court of Alaska.
May 19, 1972.
E.G. Burton and Richard A. Helm, Burr, Pease & Kurtz, Inc., Anchorage, for appellants.
Karl S. Johnstone, Nesbett & Johnstone, Anchorage, Lyle L. Iversen, and Josef Diamond, Lycette, Diamond & Sylvester, Seattle, Wash., for appellee.
Before RABINOWITZ, CONNOR and BOOCHEVER, JJ.

OPINION
CONNOR, Justice.
This is an appeal from an award of costs and attorney's fees granted to appellee *313 at the conclusion of this action in the superior court.
Appellants, Owen Jones & Sons, Inc. and Empire Western Ltd., a joint venture, entered into a subcontract agreement with C.R. Lewis Company, Inc., appellee, on July 3, 1963. Under the contract appellee agreed to furnish labor and materials necessary to complete plumbing and other systems specified in the plans for the "Four Seasons Apartment" to be built in Anchorage, Alaska. The total contract price was $178,449.19. The contract also provided for progress payments, not to exceed 90% of the contract price.
The partially completed "Four Seasons Apartment" was destroyed in the March 27, 1964, earthquake. After the quake the appellants brought an action against appellee to recover $119,663.12 that Jones-Western had disbursed to C.R. Lewis Co. as progress payments. This claim was made under a clause of the contract calling for indemnification of the contractor by the subcontractor for all damages caused "by reason of the elements, from any other person or any other craft". The subcontractor counter-claimed for $46,620.92 for services rendered and materials furnished before the collapse.
At trial without a jury the superior court accepted Jones-Western's contention that the earthquake was within the indemnity clause of the contract, but the court held that this finding did not resolve the case. It was the decision of the trial court that there could be no indemnification under the contract to supply plumbing to the "Four Seasons Apartment" because the building, the subject matter of the contract, had been destroyed, thus discharging any obligation on the subcontractor's part to furnish further performance.
After finding that the building's destruction discharged the obligation of the parties under the original contract, Judge Lewis held that C.R. Lewis Company was entitled to recover the cost of its performance from appellants on a quantum meruit basis.
The trial court decided that the subcontractor's services and materials supplied should be reasonably valued at approximately $142,300. From this figure a computation was made which took into account the amount of progress payments ($119,663.12) and the value of materials belonging to appellants which were salvaged by appellee ($30,000), representing a total value received by appellee of $149,663.12. From this total was subtracted the amount due to the appellee under the quantum meruit theory employed by the court, which left an excess of $7,363.12, the amount of judgment for appellants. Pursuant to this judgment the trial judge ordered that appellee be awarded costs and $10,000 attorney's fee.
The resolution of this controversy requires our decision on two issues. First, was it error to hold that appellee was the prevailing party in this action; and second, did the trial court abuse its discretion in the amount of the award given?
Under AS 09.60.010[1] and Rule 54(d),[2] Rules of Civil Procedure, it is clear that the prevailing party is entitled to costs.
It is the contention of the appellants that only they could be considered the prevailing parties in light of their affirmative recovery of $7,363.12 at the conclusion of the trial.
With this contention we cannot agree; it is not an immutable rule that the *314 party who obtains an affirmative recovery must be considered the prevailing party.[3] The decision of the trial court that appellee was the prevailing party did not involve an erroneous construction of either AS 09.60.010 or Rule 54(d). We are of the opinion that the determination of which party prevails in cases of this sort is, like the award of attorney's fees, within the discretion of the trial judge.[4]
This case is clearly distinguishable from Buza v. Columbia Lumber Company, 395 P.2d 511 (Alaska 1964). In Buza we affirmed an award of attorney's fees to plaintiff and held that he was the prevailing party within the terms of the statute and rule, even though he did not obtain relief to the extent urged in his complaint. The main issue in that case was the ownership of a quantity of logs, and the plaintiff proved his right to the logs although he was not able to obtain compensating or punitive damages.
The instant case differs because the recovery of appellants was based only on an accounting for materials salvaged by the appellee.[5] It was clear that the main issue had been resolved against appellants when the court found that appellee had no obligation to refund its progress payments under the contract, the obligation having been discharged by destruction of the subject matter.
Because we are of the opinion that the trial court was correct in deciding that the appellee was the prevailing party, we must also decide whether the amount of the award was proper.
Under Rule 82(a) (2), Rules of Civil Procedure, the court is empowered to "award a fee commensurate with the amount and value of legal services rendered" when "the money judgment is not an accurate criteria [sic] for determining the fee to be allowed."
It is clear from the record in this case that the court considered the efforts of appellee's counsel in defeating the appellants' claim for $119,663.12 and the value of that effort in determining the amount of the attorney's fee awarded. The trial judge also considered the potential liability that threatened appellee.[6] Finally, it is clear that the amount of attorney's fee was within the sound discretion of the trial court and such an award will not be disturbed unless the court has exceeded that discretion.[7] We find no reason to disturb the award in this case.
Affirmed.
BONEY, C.J., and ERWIN, J., not participating.
NOTES
[1]  "Costs allowed prevailing party. Except as otherwise provided by statute, the supreme court shall determine by rule or order what costs, if any, including attorney fees, shall be allowed the prevailing party in any case."
[2]  "Costs. Except when express provision therefor is made either in a statute of the state or in these rules, costs shall be allowed as of course to the prevailing party unless the court otherwise directs. The procedure for the taxing of costs by the clerk and review of his action by the court shall be governed by Rule 79."
[3]  Haugland v. Canton, 250 Minn. 245, 84 N.W.2d 274 (Minn. 1957); Milner v. New Edinburg School Dist., 211 Ark. 337, 200 S.W.2d 319 (1947); Null v. Board of Comm'rs, 98 Okl. 16, 224 P. 159 (1924); Wymer v. Dagnillo, 162 N.W.2d 514 (Iowa 1968); McCrary v. New York Life Ins. Co., 84 F.2d 790, 795 (8th Cir.1936).
[4]  The following Alaska cases hold that the award of attorney's fees is within the discretion of the trial judge. McDonough v. Lee, 420 P.2d 459 (Alaska 1966); Preferred General Agency of Alaska, Inc. v. Raffetto, 391 P.2d 951, 954 (Alaska 1964).
[5]  This recovery based on the accounting can be classified as an incidental recovery which will not be a sufficient recovery to bar a party who has defended a large claim from being considered a prevailing party. Haugland v. Canton, 250 Minn. 245, 84 N.W.2d 274 (1957); Milner v. New Edinburg School Dist., 211 Ark. 337, 200 S.W.2d 319 (1947); Null v. Board of Comm'rs, 98 Okl. 16, 224 P. 159 (1924).
[6]  Ferrell v. Baxter, 484 P.2d 250, 271 (Alaska 1971).
[7]  See cases cited note 4, supra.
