
17 Cal.4th 632 (1998)
EMPLOYERS MUTUAL LIABILITY INSURANCE COMPANY OF WISCONSIN, Plaintiff and Respondent,
v.
TUTOR-SALIBA CORPORATION, Defendant and Appellant.
Docket No. S058283.
Supreme Court of California.
March 2, 1998.
*635 COUNSEL
Millard, Pilchowski, Holweger & Child, Jeniffer Wilder and Bradford T. Child for Defendant and Appellant.
Robert T. Moulton for Plaintiff and Respondent.
OPINION
BROWN, J.
A subcontractor's workers' compensation insurance carrier brought an action against the general contractor to recover compensation benefits paid to the subcontractor's employee. The issue in this case is whether an express provision for attorney fees in the contract between the general contractor and the subcontractor (the injured worker's employer) applies to permit recovery of fees in the action between the insurance carrier and the general contractor. The Court of Appeal concluded that attorney fees are not available. We disagree, and therefore reverse its judgment.

I. FACTS AND PROCEDURAL BACKGROUND
George Staehling was injured when he fell down a flight of stairs while working for PDM Strocal, Inc. (PDM), a subcontractor on an office building and parking structure. Tutor-Saliba Corporation (Tutor-Saliba) was the general contractor, and Cowelco, Inc. (Cowelco) was the subcontractor that had installed the stairs. Staehling received workers' compensation benefits from PDM's workers' compensation insurer, Employers Mutual Liability Insurance Company of Wisconsin (Wisconsin).
Staehling also filed a personal injury action against Cowelco and Tutor-Saliba. Wisconsin intervened in the lawsuit pursuant to Labor Code[1] sections *636 3852 and 3853[2] to recover the benefits paid to Staehling. Staehling's personal injury action and all other claims were settled and dismissed, except for Wisconsin's claim for reimbursement of workers' compensation benefits from Tutor-Saliba and Cowelco. A jury placed a value of $1,491,000 on Staehling's injuries and apportioned liability as follows: Staehling 20 percent, PDM 20 percent, Cowelco 50 percent, and Tutor-Saliba 10 percent. Because the resulting sum of damages attributed to PDM's negligence exceeded the amount of workers' compensation benefits paid by Wisconsin to Staehling, Wisconsin recovered nothing. (See Aceves v. Regal Pale Brewing Co. (1979) 24 Cal.3d 502, 512 [156 Cal. Rptr. 41, 595 P.2d 619], overruled on other grounds in Privette v. Superior Court (1993) 5 Cal.4th 689, 702, fn. 4 [21 Cal. Rptr.2d 72, 854 P.2d 721] ["Since [employer's] percentage share of responsibility for plaintiff's recovery is greater than the compensation benefits it paid, its carrier's claim for reimbursement should be denied."].)
As relevant here, Tutor-Saliba filed a memorandum of costs and a motion for $91,218.95 for attorney fees incurred since the filing of Wisconsin's complaint in intervention. The attorney fees motion was based on the fees clause in Tutor-Saliba's subcontract with PDM, which provided that with the exception of claims by PDM against the owner, "All other claims and disputes between the parties shall be decided by the appropriate California State Court in the County of Los Angeles. The prevailing party, shall be entitled to recover its attorneys' fees, witness fees and other expenses related to preparation and presentation of its case in a reasonable amount." The trial court found that Tutor-Saliba was not the prevailing party and denied the motion for attorney fees, but exercised its discretion to allow Tutor-Saliba recovery of certain costs other than attorney fees.
Tutor-Saliba appealed from the order denying the motion for attorney fees. The Court of Appeal affirmed. It did not consider whether Tutor-Saliba was the prevailing party under Code of Civil Procedure section 1032, subdivision (a)(4), or whether the terms of the subcontract provided for *637 attorney fees under these circumstances. Rather, it held that Tutor-Saliba was not entitled to attorney fees because of what it perceived to be the unique context of workers' compensation law.
We granted Tutor-Saliba's petition for review.

II. DISCUSSION

A. General Workers' Compensation and Insurance Principles

(1) In general, "when a worker is entitled to workers' compensation benefits for an injury, those benefits constitute the worker's exclusive remedy against his or her employer for injuries sustained in the course of employment. (Lab. Code, § 3602, subd. (a).)" (Phelps v. Stostad (1997) 16 Cal.4th 23, 30 [65 Cal. Rptr.2d 360, 939 P.2d 760], italics omitted.) "[T]he legal theory supporting such exclusive remedy provisions is a presumed `compensation bargain,' pursuant to which the employer assumes liability for industrial personal injury or death without regard to fault in exchange for limitations on the amount of that liability. The employee is afforded relatively swift and certain payment of benefits to cure or relieve the effects of industrial injury without having to prove fault but, in exchange, gives up the wider range of damages potentially available in tort." (Shoemaker v. Myers (1990) 52 Cal.3d 1, 16 [276 Cal. Rptr. 303, 801 P.2d 1054, 20 A.L.R.5th 1016].)
(2) Despite the exclusivity of the workers' compensation remedy against the employer, the worker may recover a judgment from a negligent third party. (§ 3852; Phelps v. Stostad, supra, 16 Cal.4th at p. 30.) Likewise, an employer who pays or becomes obligated to pay workers' compensation benefits to an injured employee may seek reimbursement from the third party. (Ibid.) "[W]e have indicated that, in granting employers the right to sue third parties, the Legislature simply gave statutory recognition to principles of equitable subrogation. [Citations.]" (County of San Diego v. Sanfax Corp. (1977) 19 Cal.3d 862, 876, fn. 7 [140 Cal. Rptr. 638, 568 P.2d 363].) "Apparently, even if the Legislature had not acted, an employer would have been able to recover from a third party who was responsible for the employer having to pay workers compensation...." (Ibid.)
Reimbursement may be pursued in three ways: "the employer `may bring an action directly against the third party (§ 3852), join as a party plaintiff or intervene in an action brought by the employee (§ 3853), or allow the employee to prosecute the action himself and subsequently apply for a first lien against the amount of the employee's judgment, less an allowance for *638 litigation expenses and attorney's fees (§ 3856, subd. (b)).' [Citation.]" (Associated Construction & Engineering Co. v. Workers' Comp. Appeals Bd. (1978) 22 Cal.3d 829, 833 [150 Cal. Rptr. 888, 587 P.2d 684].) An employer is accountable for its own negligence in causing the employee's injury, and therefore is only reimbursed for the amount by which its compensation liability exceeds its proportional share of the injured employee's recovery. (Aceves v. Regal Pale Brewing Co., supra, 24 Cal.3d at p. 512.) The employee's fault in causing the injury is not attributed to the employer for purposes of reducing reimbursement. (Cal. Workers' Damages Practice (Cont.Ed.Bar 1985) § 4.1, p. 75.)
The employer can be sued apart from the employee by the third party for indemnification if the employer has executed an indemnification contract with the third party prior to the time of the injury. (§ 3864.) Section 3864 provides: "If an action ... prosecuted by the employee, the employer, or both jointly against the third person results in judgment against such third person, or settlement by such third person, the employer shall have no liability to reimburse or hold such third person harmless on such judgment or settlement in absence of a written agreement so to do executed prior to the injury." (3) Section 3864 "enforces the exclusivity of workers' compensation by precluding concurrent tortfeasors from seeking indemnification from negligent employers" absent a written agreement executed prior to the injury. (Western Steamship Lines, Inc. v. San Pedro Peninsula Hospital (1994) 8 Cal.4th 100, 113 [32 Cal. Rptr.2d 263, 876 P.2d 1062], fn. omitted.) Prior to the statute's enactment in 1959, the employer was potentially liable not only for the injured employee's workers' compensation benefits, but also for additional damages awarded to the employee at common law. (Ibid.) "`"The California legislature felt that this double burden placed upon the employer was in contravention of the exclusive remedy theory of the workmen's compensation statutes"', and therefore enacted Labor Code section 3864 to abolish any right to indemnity other than by express contract. [Citation.]" (Ibid.)
(4) "In California, every employer except the state is required to `secure the payment of compensation.' (Lab. Code, § 3700.) This mandate is satisfied by either purchasing workers' compensation insurance, or self-insuring. (Ibid.)" (La Jolla Beach & Tennis Club, Inc. v. Industrial Indemnity Co. (1994) 9 Cal.4th 27, 36 [36 Cal. Rptr.2d 100, 884 P.2d 1048].) "Employers who comply with the insurance requirement [citation] are relieved of liability for compensation, and the insurance carrier assumes liability." (2 Witkin, Summary of Cal. Law (9th ed. 1987) Workers' Compensation, § 137, p. 708.) The insurer is then subrogated to all of the rights and liabilities of the *639 employer. (Ins. Code, § 11662;[3]Burum v. State Compensation Ins. Fund (1947) 30 Cal.2d 575, 580 [184 P.2d 505] ["If the employer is insured against workmen's compensation liability, the insurer has the same right of action as the employer, or is subrogated to the employer's right."]; 2 Witkin, Summary of Cal. Law, supra, Workers' Compensation, § 137, p. 708; see Liberty Mut. Ins. Co. v. Fales (1973) 8 Cal.3d 712, 717 [106 Cal. Rptr. 21, 505 P.2d 213] ["Under settled principles, an insurer in its role as subrogee has no greater rights than those possessed by its insured, and its claims are subject to the same defenses."]; Herrick Corp. v. Canadian Ins. Co. (1994) 29 Cal. App.4th 753, 765 [34 Cal. Rptr.2d 844] ["Equitable subrogation allows a `paying insurer to be placed in the shoes of the insured and to pursue recovery from third parties responsible to the insured for the loss for which the insurer was liable and paid.' [Citation.]"].)
Subrogation is a right, not an obligation, and the employer cannot force the insurer to pursue a reimbursement claim against the third party. (See New Plumbing Contractors, Inc. v. Nationwide Mutual Ins. Co. (1992) 7 Cal. App.4th 1088, 1092, 1095 [9 Cal. Rptr.2d 469] [Insurer is not liable for employer's increased premiums because insurer is not required to pursue particular method of reimbursement, and "[f]urthermore, because subrogation is a right, not an obligation, the insurer presumably has the option of not pursuing subrogation recovery at all."].) If an insurer is not persuaded of the merit of a claim against the third party, it can simply decline to either bring suit or intervene in the employee's action.

B. Application of These Principles Here

(5) As set forth above, an employer is subrogated to the personal injury claim of the employee against the third party. Therefore, the employer's insurer is also so subrogated when it stands in the shoes of the employer. The insurer is also, however, subrogated to the employer's additional rights and liabilities against the third party. For example, while the employee has no claim for reimbursement of workers' compensation benefits against the third party, the employer, and therefore its insurer, does. Likewise, the third party has certain defenses against the employer such as the employer's concurrent negligence in causing the employee's injury. The insurer is also subject to such defenses, as demonstrated in this case where Wisconsin *640 failed to recover any reimbursement from Tutor-Saliba because the damages attributed to PDM's negligence in causing Staehling's injury exceeded the amount of benefits paid. (See Aceves v. Regal Pale Brewing Co., supra, 24 Cal.3d at p. 512; Royal Indem. Co. v. Security Truck Lines (1963) 212 Cal. App.2d 61, 66 [27 Cal. Rptr. 858] ["Any defense which the wrongdoer has against the insured is good against the insurer...."].)
It is logical to conclude that the insurer should likewise be subrogated to  i.e., both benefited and bound by  any contract providing for attorney fees to a prevailing party that the employer and the third party have executed. If PDM had filed a claim for reimbursement, it would be liable for attorney fees if it failed to prevail. Wisconsin does not argue otherwise. Having brought suit itself, and affirmatively taken on the role of its insured, Wisconsin should be similarly liable if it failed to prevail. (See Catello v. I.T.T. General Controls (1984) 152 Cal. App.3d 1009, 1011, 1015 [200 Cal. Rptr. 4] [workers' compensation insurer that files a complaint in intervention is liable for costs in the same manner as the original parties].)
These principles are illustrated in Allstate Ins. Co. v. Loo (1996) 46 Cal. App.4th 1794 [54 Cal. Rptr.2d 541], on which Tutor-Saliba relies. In Allstate, fire destroyed the personal property of certain tenants living in an apartment owned by Loo. (Id. at p. 1796.) They filed a claim with their insurer, Allstate. After paying the claim, Allstate brought an action "in subrogation against Loo, asserting causes of action for negligence, failure to disclose a latent defect, and breach of an implied warranty of habitability." (Ibid.) Summary judgment was entered in Loo's favor. (Ibid.) Loo then sought attorney fees pursuant to a lease provision authorizing attorney fees to the prevailing party "`[i]n any legal action brought by either party to enforce the terms hereof or relating to the demised premises.'" (Id. at pp. 1796-1797.) The trial court denied Loo's request for attorney fees, and the Court of Appeal reversed. (Id. at pp. 1797, 1801.) As relevant here, the Court of Appeal concluded that an insurer/subrogee assumes an insured/subrogor's contractual liability for attorney fees. (Id. at p. 1799.) The court stated, "had Allstate prevailed against Loo, it would have succeeded to the rights of the insured/subrogor to recover a reasonable attorney fee. We have been offered no reason in law or logic why the converse should not also be true. Loo's obligation to defend against the action was the same irrespective of the identity of the plaintiff: the lessee or the lessee's subrogee. We therefore hold that Loo, as the prevailing party, is entitled to assert his contractual right to recover reasonable attorney fees in the subrogation action." (Id. at p. 1800.)
Allstate argued that such a result was "bad social policy: `To allow counterclaims against the subrogated insurer means that the insurer's risk *641 depends on factors that are unrelated to the risks for which it earned premiums.'" (Allstate Ins. Co. v. Loo, supra, 46 Cal. App.4th at p. 1800.) The court observed that "recovery of attorney fees is not accomplished by counterclaim: it is an item of costs which has been agreed to by contract. [Citation.] Nor does our ruling increase any risk to insurers. In this case the risk the insurer undertook to insure against was the risk of fire damage to personal property of its insureds. The insurer lost that risk and paid its policyholders. Nothing in our decision increases or decreases that risk. After making payment the insurer had a decision to make: whether to sue the owner of the building in which the fire occurred. The insurer decided to do that but lost. We assume that the decision to so litigate was intelligently made after weighing the risks that all those who instigate litigation face. That list includes the risk of not prevailing which includes the risk of bearing all of the cost of the litigation  especially in a case in which there is a contract providing for the payment of the prevailing party's attorney fees." (Ibid.)
The Court of Appeal here concluded that Allstate was not applicable in the context of workers' compensation. It held that "while the law recognizes that the carrier stands in the shoes of the employer, the claim for reimbursement does not flow from the relationship established by the contract between [Tutor-Saliba] and PDM. Instead, [Wisconsin's] claim for recovery is based upon its duty to pay benefits to the injured employee because of the relationship between the employee and PDM. Section 3852 allows the employer or the carrier to intervene in the employee's action against the third party and all rights for reimbursement flow from the employee's claim, a claim which traditionally does not provide a basis for an award of attorney fees. [Fn. omitted.] There is no indication in this case that had Staehling prosecuted his action to a conclusion he would have been able to recover attorney fees against [Tutor-Saliba]. Thus, Allstate is not applicable. [¶] We conclude that it would be improper to insert into the statutory scheme of workers' compensation a right to recovery of attorney fees on behalf of the third party defendant."
Concluding that Wisconsin is subrogated to PDM's liabilities, such as its agreement with a third party to pay attorney fees to the prevailing party, as well as its rights, such as its right to seek reimbursement from a negligent third party, is not inserting a right to recovery of attorney fees into the workers' compensation scheme. Rather, it is applying well-established principles of insurance law. Wisconsin's potential liability for attorney fees arises because of its insured's agreement to pay attorney fees under certain circumstances that may obtain here, including Wisconsin's own decision to *642 pursue litigation against Tutor-Saliba in which it apparently failed to prevail. This is a matter the parties themselves can regulate and economically prepare for.
Thus, the question of whether a third party is entitled to contractual attorney fees from the insurer when it defeats a claim for reimbursement does not depend on whether the employee would have been so entitled, but on the terms of the contract between the insured employer and the third party. (Code Civ. Proc., § 1021 ["Except as attorney's fees are specifically provided for by statute, the measure and mode of compensation of attorneys and counselors at law is left to the agreement, express or implied, of the parties...."].) By analogy, a third party's right to indemnity from the employer under section 3864 would not depend on whether the employee could recover under such a theory, but on what the indemnity contract between the third party and the employer provided.
Wisconsin argues that Tutor-Saliba "is attempting to enforce upon Wisconsin the obligations of a contract to which it was not a party [n]or was there any privity between Wisconsin and [Tutor-Saliba]." As Wisconsin concedes, however, subrogation is a right, not an obligation, and the employer cannot force the insurer to pursue a reimbursement claim against the third party. (See New Plumbing Contractors, Inc. v. Nationwide Mutual Ins. Co., supra, 7 Cal. App.4th at p. 1095.) If Wisconsin was concerned about the merits of the claim against Tutor-Saliba, it could have declined to intervene. By choosing to pursue a complaint in intervention for reimbursement, Wisconsin stood in the shoes of its insured, and was thereby bound by the provisions contained in the contract between its insured, PDM, and Tutor-Saliba. Privity is not necessary, since common law principles of equitable subrogation dictate that Wisconsin acquires not only PDM's claim for reimbursement, but its liabilities as well.
Wisconsin further asserts that Civil Code section 1717 does not apply because the "Staehling action and the Wisconsin intervention did not involve any action to enforce a contract as required by Civil Code section 1717(a)." That is correct. Tutor-Saliba is not, however, seeking relief under Civil Code section 1717.
As noted above, the trial court concluded that Tutor-Saliba was not the prevailing party, and hence denied the motion for attorney fees. The Court of Appeal did not consider whether Tutor-Saliba was the prevailing party under Code of Civil Procedure section 1032, subdivision (a)(4), or whether the terms of the subcontract provided for attorney fees under these circumstances. Rather, it concluded that there was no legal basis for entitlement to *643 an award of attorney fees in the unique context of workers' compensation. There is no reason for us to do so in the first instance, and we therefore remand the case to the Court of Appeal for consideration of these issues.

CONCLUSION
The judgment of the Court of Appeal is reversed, and the case remanded for further proceedings in accordance with this opinion.
George, C.J., Mosk, J., Kennard, J., Baxter, J., Werdegar, J., and Chin, J., concurred.
NOTES
[1]  All further statutory references are to the Labor Code unless otherwise indicated.
[2]  Section 3852 provides in relevant part: "The claim of an employee ... for compensation does not affect his or her claim or right of action for all damages proximately resulting from the injury or death against any person other than the employer. Any employer who pays, or becomes obligated to pay compensation ... may likewise make a claim or bring an action against the third person. In the latter event the employer may recover in the same suit, in addition to the total amount of compensation, damages for which he or she was liable including all salary, wage, pension, or other emolument paid to the employee...." The term "employer" includes an insurer. (§ 3850, subd. (b).)

Section 3853 provides in relevant part: "If the action is brought by either the employer or employee, the other may, at any time before trial on the facts, join as party plaintiff or shall consolidate his action, if brought independently."
[3]  Insurance Code section 11662 provides: "Whenever any employer is insured against liability for compensation with any insurer, such insurer is subrogated to the rights of the employer to recover losses arising out of any of the following acts by the insurer: [¶] (a) Assuming the liability of the employer for compensation in the manner provided by the law relating thereto. [¶] (b) Payment of any compensation for which the employer is liable. [¶] Such insurer may enforce any such subrogated rights in its own name."
