
159 Cal.App.3d 828 (1984)
205 Cal. Rptr. 754
C.L. PECK CONTRACTORS et al., Petitioners,
v.
THE SUPERIOR COURT OF LOS ANGELES COUNTY, Respondent; PIERCE ENGINEERING COMPANY, Real Party in Interest.
Docket No. B005096.
Court of Appeals of California, Second District, Division Two.
August 29, 1984.
*830 COUNSEL
David L. Winter, and Hagenbaugh & Murphy for Petitioners.
No appearance for Respondent.
Stephen L. Thomas, Jay J. Elliott, and Thomas & Elliott for Real Party in Interest.
*831 OPINION
ROTH, P.J.
In this case we decide that a good faith settlement between a plaintiff and a defendant under Code of Civil Procedure section 877.6 does not bar the remaining codefendants from seeking indemnity from the settling defendant based on an express contract.
On July 17, 1980, Joseph Ventura was injured while working at a construction site. He sued C.L. Peck Contractors, the general contractor; Century 98 Associates, the owner (Petitioners); and Pierce Engineering Company (Real Party in Interest), a subcontractor.
Mr. Ventura settled his claim against Pierce. Pursuant to Code of Civil Procedure section 877.6, Pierce sought from the trial court a declaration that the settlement was in good faith, and a dismissal of all cross-claims for indemnification. Petitioners opposed dismissal of their cross-claim to the extent the claims were provided for by contract with Pierce.[1] The court granted Pierce's motion, reasoning that a section 877.6 settlement extinguishes all claims for indemnity, even those provided for by contract. Petitioners filed their petition for a writ of mandate with this court. We issued the alternative writ to definitively settle this important question.
The California Supreme Court in Li v. Yellow Cab Co. (1975) 13 Cal.3d 804 [119 Cal. Rptr. 858, 532 P.2d 1226, 78 A.L.R.3d 393] announced the rule of comparative negligence in California. American Motorcycle Assn. v. Superior Court (1978) 20 Cal.3d 578 [146 Cal. Rptr. 182, 578 P.2d 899] extended the new rule to multiple defendants, and we were taught that equitable indemnity was not to be an all or nothing affair, but would also be based on comparative negligence. The court stated: "[W]e conclude ... that a tortfeasor who has entered into a `good faith' settlement [citation] with the plaintiff must also be discharged from any claim for partial or comparative indemnity that may be pressed by a concurrent tortfeasor." *832 (Id., at p. 604.) (1) Code of Civil Procedure section 877.6, enacted in 1980, is the legislative incarnation of this pronouncement. (Turcon Construction Inc. v. Norton-Villiers, Ltd. (1983) 139 Cal. App.3d 280, 283 [188 Cal. Rptr. 580].) It states in pertinent part:
"(a) Any party to an action wherein it is alleged that two or more parties are joint tortfeasors shall be entitled to a hearing on the issue of the good faith of a settlement entered into by the plaintiff or other claimant and one or more alleged tortfeasors....
".... .... .... .... .... .... .
"(c) A determination by the court that the settlement was made in good faith shall bar any other joint tortfeasor from any further claim against the settling tortfeasor for equitable comparative contribution, or partial or comparative indemnity based on comparative negligence or comparative fault." (Italics added.)
(2a) Whether Code of Civil Procedure section 877.6 bars claims of indemnity grounded in contract has not yet been squarely faced and answered, but it is not new. It was raised in Kohn v. Superior Court (1983) 142 Cal. App.3d 323 [191 Cal. Rptr. 78]. The court there did not decide the issue, finding that it was not properly presented for decision. Several cases in dicta have assumed, without deciding, that contractually assumed liability is unaffected by section 877.6. In Pappert v. San Diego Gas & Electric Co. (1982) 137 Cal. App.3d 205 [186 Cal. Rptr. 847], the court's factual summary included this statement: "When pre-trial settlement resulted in a dismissal of plaintiff's complaint against Asplundh, SDG&E's cross complaint against Asplundh was dismissed as to the equitable indemnity action, leaving only its claim for express contractual indemnity." (Id. at p. 208-209, italics added.)
In the case of Turcon Construction, Inc. v. Norton-Villiers, Ltd., supra, 139 Cal. App.3d at p. 284, this Division noted: "Appellant's Cross-Complaint does not rest on any contractual indemnity nor does it allege that its liability vis-a-vis respondents is one imposed as a matter of law because of its relationship with respondent. [Citation.] In summary the complaint contains no allegations which would provide the basis for shifting of total liability to respondent."
In City of Sacramento v. Gemsch Investment Co. (1981) 115 Cal. App.3d 869 [171 Cal. Rptr. 764], the court stated: "Where the transaction rests upon related facts, either concurrent or successive, joint or several, which legally create a detriment compensable against multiple actors, the right of indemnity *833 should follow AMA guidelines, unless the contract or statute otherwise provides." (Id., at p. 877, italics added.)
In Rodriguez v. McDonnell Douglas Corp. (1978) 87 Cal. App.3d 626 [151 Cal. Rptr. 399] the court points out: "None of the discussion in American Motorcycle leads to the slightest suggestion that the court was addressing itself to the all or nothing right of indemnification that is created by the parties to an indemnity contract." (Id., at p. 676.)
Finally, this court in County of Los Angeles v. Superior Court (1984) 155 Cal. App.3d 798 [202 Cal. Rptr. 444], stated: "[T]hose sections [Code Civ. Proc., §§ 877 and 877.6] do not operate to bar otherwise valid claims by express or implied indemnity arising out of a contractual relationship." (Id., at p. 803.) This statement has the character of an alternate holding; as we declared, the decision actually depends on the conclusion that "[t]hose sections apply only to joint tortfeasors and in our opinion County's role is not that of a tortfeasor." (Ibid.)
(3) We recognize that Code of Civil Procedure section 877 presents a problem. Subdivision (b) of that section provides that settlement "shall discharge the tortfeasor to whom it is given from all liability for any contribution to any other tortfeasors." (Italics added.) This language does not fit comfortably with that of section 877.6, and suggests the result urged by Pierce. Section 877 was enacted in 1957, well before the introduction of comparative negligence into California jurisprudence. It has not been amended since then. We believe that the Legislature, when it enacted section 877.6, simply neglected to amend 877 to conform to the new rule of comparative negligence. We therefore resolve the ambiguity by holding that the more general language of section 877, subdivision (b) is subordinated to section 877.6, subdivision (c), the more recent and more specific expression of the legislative will.
We are mindful of the differences between indemnity based on contract and indemnity based on equitable considerations. (4) "The obligation of indemnity ... may arise under the laws of this state from either of two general sources. First, it may arise by virtue of express contractual language.... Second, it may find its source in equitable considerations brought into play either by contractual language not specifically dealing with indemnification or by the equities of the particular case. [Citations.] [¶] Each of these two basic forms of indemnity is subject to its own distinctive legal rules and limitations. Those governing so-called "express" indemnity reflect its contractual nature, permitting great freedom of action to the parties in the establishment of the indemnity arrangement while at the same time subjecting the resulting contractual language to established rules of construction.... *834 [¶] (5) Within the limitations of the language used, however, an express indemnity clause is accorded a certain preemptive effect, displacing any implied rights which might otherwise arise within the scope of its operation. Thus, as we stated in Markley v. Beagle (1967) 66 Cal.2d 951 at page 971, [59 Cal. Rptr. 809, 429 P.2d 129], when parties by express contractual provision establish a duty in one party to indemnify another, `the extent of that duty must be determined from the contract and not from the independent doctrine of equitable indemnity.' (Italics added.) [Citations.] When, however, the duty established by contract is by the terms and conditions of its creation inapplicable to the particular factual setting before the court, the equitable principles of implied indemnity may indeed come into play." (E.L. White, Inc. v. City of Huntington Beach (1978) 21 Cal.3d 497, 506-508 [146 Cal. Rptr. 614, 579 P.2d 505].)
(6) The implication of the last quoted statement is that when contractual indemnity is applicable, the doctrine of equitable indemnity does not come into play. Thus, the law permits people to voluntarily order their affairs in a manner agreeable to them and equity rarely interferes with a contract knowledgeably executed.
Pierce insists that this result is untenable because of a strong policy favoring settlement of claims. (Widson v. International Harvester Co. (1984) 153 Cal. App.3d 45, 57 [200 Cal. Rptr. 136].) A tortfeasor will have no motivation to settle with plaintiffs, Pierce reasons, if he remains exposed to liability on cross-claims. There are two answers to this position. One: A tortfeasor may decide that it is to his advantage to avoid a "war on two fronts", by settling with one of his claimants. Two: Although admittedly the law favors settlement, competing interests frequently require the reconciliation of diverse goals and thus preclude an interpretation of the specific statute which would result in a total commitment to the policy favoring settlement. At bench the policy favoring settlement must be subordinated to the policy favoring enforcement of contracts, statutorily reflected in section 877.6.
(2b) We hold that an indemnity claim against a codefendant based on express contract survives a good faith section 877.6 settlement. The Legislature, by specifying equitable comparative indemnity, evidenced its intention to exclude contractual indemnity. The language of section 877.6 is clear, and we are not free to depart from it.
At bench Pierce has agreed by express contract to indemnify C.L. Peck and Century 98 Associates for their losses. Petitioners may enforce that agreement in spite of Pierce's good faith settlement with plaintiff Ventura. *835 Code of Civil Procedure section 877.6 by its terms has no application to contractual indemnity claims.
Pierce asserts that the indemnity clause is invalid under Civil Code section 1668 (forbidding contracts which exempt anyone from responsibility for his own violation of law); under Civil Code section 2782 (forbidding indemnity clauses for damages arising from the sole negligence of the promisee); and under the theory that the indemnity clause does not apply to the facts of this case. These assertions are out of place here. They must be tested at trial. (See Huizar v. Abex Corp. (1984) 156 Cal. App.3d 534, 542 [203 Cal. Rptr. 47].[2]
The alternative writ is discharged. Let a peremptory writ of mandate issue directing the trial court to vacate its order granting Pierce's motion to dismiss petitioners' cross-claim for contractual indemnity and to enter a new and different order denying said motion.
Compton, J., and Beach, J., concurred.
The petition of real party in interest for a hearing by the Supreme Court was denied November 15, 1984.
NOTES
[1]  "Subcontractor [Pierce Engineering Company] shall assume liability and indemnify the contractor [C.L. Peck Contractor] and owner [Century 98 Associates] from and against any liability and all loss, costs, damages, expenses, including attorney's fees, on account of claims for personal injury, including death, sustained by any person or persons whomsoever, including contractor, their subcontractors and employees of subcontractor, and for injury to or destruction of property of any such person or organization, including loss of use thereof, arising out of:

"(a) The performance of the subcontract work;
"(b) Active or passive negligence of contractor, subcontractor or subcontractor's agents, employees, invitees or subcontractors;
"(c) Use by subcontractor of contractor's equipment, labor or facilities as provided in paragraph 7.2 hereof, regardless of whether (1) contractor shall have consented to such use, and (2) the injury or damage shall have been caused by unsafe conditions, the active or passive negligence of contractor or otherwise."
[2]  Huizar holds that a cause of action for total equitable indemnification survives a good faith settlement and supports our analysis that a settlement entered pursuant to Code of Civil Procedure section 877.6 only discharge indemnification claims based on theories of partial or comparative negligence. (See also E.L. White, Inc. v. City of Huntington Beach (1982) 138 Cal. App.3d 366 [187 Cal. Rptr. 879] [full indemnity may still be obtained notwithstanding language in Code Civ. Proc., § 877.6 about partial indemnity].)
