I dissent.
I agree with Justice Mosk’s disagreement with the majority, but I place my disagreement on broader grounds.
*227The majority relies in part upon the three cases of Associated Convalescent Enterprises v. Carl Marks & Co., Inc. (1973) 33 Cal.App.3d 116 [108 Cal.Rptr. 782]; Gray v. Kay (1975) 47 Cal.App.3d 562 [120 Cal.Rptr. 915]; and Samuels v. Sabih (1976) 62 Cal.App.3d 335 [133 Cal.Rptr. 74]. The majority apparently approves of the reasoning set forth in these three cases that a defendant is not entitled to attorney’s fees under Civil Code section 1717 because a voluntary dismissal by plaintiff does not constitute a final judgment within the meaning of section 1717 which defines the prevailing party to be a party in whose favor a final judgment is rendered. In my view the reasoning advanced in these three cases is not persuasive. Hence, this court should disapprove of the results reached in these cases.
The majority presents no convincing reasons why a voluntary dismissal of an action by plaintiff should not be considered a final judgment for the purposes of making the defendant a prevailing party under section 1717. The fact that a plaintiff, who voluntarily dismisses his action without prejudice, may refile the action, does not preclude a holding that such dismissal is a final determination of that proceeding and is thus a final judgment. It is to be noted that Civil Code section 1717 does not require that a final judgment must be a judgment on the merits in order for a party to be a prevailing party.
The Legislature did not intend by use of the phrase “final judgment” in Civil Code section 1717 that a termination of a lawsuit should be considered a final judgment only if such termination was on the merits. In chapter 1 (Judgment in General) of title 8 of the Code of Civil Procedure, section 582 follows sections 577 through 581 which deal with an assortment of various types of judgments which are not judgments on the merits. Section 582 follows with its provisions that “[i]n all other cases judgment shall be rendered on the merits.” Had the Legislature in section 1717 of the Civil Code intended that, for the purposes of obtaining attorney’s fees, a prevailing party shall be limited to a party who has obtained a final judgment on the merits in his favor, language similar to that set forth in Code of Civil Procedure section 582 would have been used.
Since a plaintiff’s voluntary dismissal of an action “finally disposes of the particular action and prevents further proceedings as effectually as would any formal judgment based on ruling on demurrer, or on findings or verdict on the facts” (Southern Pac. R.R. Co. v. Willett (1932) 216 Cal. 387, 390 [14 P.2d 526]), it should be deemed a final judgment in *228defendant’s favor—thus carrying out the legislative intent of Civil Code section 1717 to permit defendant’s recovery of attorney’s fees as the prevailing party.
The majority reaches its result primarily on what it deems “sound public policy and recognized equitable considerations.” The majority places heavy reliance upon Ecco-Phoenix Electric Corp. v. Howard J. White, Inc. (1969) 1 Cal.3d 266 [81 Cal.Rptr. 849, 461 P.2d 33], The majority points out that the Ecco-Phoenix Electric Corp. court rejected a literal and inflexible interpretation of an attorney’s fee clause in the parties’ written contract involved in that case, and applied equitable principles, and that these principles support the majority’s result in the case at bench. But I see nothing in the Ecco-Phoenix Electric Corp. case which supports the majority’s view that an application of “sound public policy” and “equitable considerations” to the case before us requires the result that a defendant should not be entitled to attorney’s fees when plaintiff voluntarily dismisses his action.
In Ecco-Phoenix Electric Corp., a printed form contract between a subcontractor and contractor, drawn by the subcontractor, contained a clause which provided: “ ‘Should litigation be necessary to enforce any term or provision of this agreement, then all litigation and court costs and reasonable attorney’s fees shall be borne wholly by the Sub-Contractor.’ ” (See Ecco-Phoenix Electric Corp., supra, 1 Cal.3d 266, 272.) (Latter italics added.) The court found this clause to be ambiguous, stating: “We find the clause less than certain on its face, leaving unanswered such questions as ‘litigation’ by whom, and made ‘necessary’ by whom.” (Id., at p. 272.) The court concluded that a “reasonable interpretation” of the attorney’s fees clause required the subcontractor to be “liable for costs and attorney’s fees only if it, the subcontractor, has made the litigation ‘necessaiy.’ ” (Id., at p. 272.)
All that the Ecco-Phoenix Electric Corp. court did was to reject a literal interpretation of the attorney’s fee clause and apply generally recognized standards of contractual interpretation. Thus, the court stated: “As this printed form contract was prepared by defendant, and in light of the oppressive nature of a literal interpretation of the clause, we resolve any uncertainties in favor of a fair and reasonable interpretation and against the inflexible construction adopted by the trial court. [Citations.]” (Ecco-Phoenix Electric Corp., supra, 1 Cal.3d 266, 272.)
*229The case at bench does not begin to present a problem of a literal construction of Civil Code section 1717 of an oppressive nature and which would produce an inequitable result. The language used by the Legislature in section 1717 is not remotely similar to the one-sided language of the printed form contract which Ecco-Phoenix Electric Corp. found to be oppressive if interpreted literally. The majority takes the view that to interpret section 1717 to permit a defendant to recover attorney’s fees when a plaintiff voluntarily dismisses an action before trial would constitute a mechanical application of the section. But the majority’s result produces a mechanical application of section 1717—a type of application which it professes to abhor. If an automatic award of fees to defendant in such a case constitutes a mechanical application of the section, so does the majority’s result of automatically denying fees upon a plaintiff’s voluntary dismissal of the action. An interpretation of section 1717 cannot rest logically or reasonably upon the assumption that one interpretation represents a mechanical application of the statute while the reverse interpretation is grounded in sound public policy and equitable considerations.
The majority seems to think that permitting a defendant to recover attorney’s fees in cases of a voluntary dismissal by a plaintiff would encourage plaintiffs to maintain pointless litigation. In my view the recovery of attorney’s fees by a defendant upon a voluntary dismissal of the action by plaintiff would be in the interest of sound public policy and in accord with equitable principles, since it would tend to discourage the filing of nonmeritorious actions by a party to a contract containing an attorney’s fee clause. With knowledge that a voluntary dismissal will result in fees to the defendant, one party to the contract is not likely to start litigation based on the contract unless such party feels he has a reasonable opportunity of prevailing.
I find no magic in language used by the majority—sound public policy and equitable considerations. Both of these concepts, like beauty, have different meanings, dependent upon the eyes and ideas of the beholder. I consider that the majority’s view of adopting an interpretation of Civil Code section 1717 that denies to defendant a right to attorney’s fees when there is a voluntary dismissal by plaintiff will encourage the filing of fruitless and nonmeritorious litigation and does violence to the same sound public policy and equitable principles which the majority espouses on the basis of Ecco-Phoenix Electric Corp. The majority stresses the fact that, although a plaintiff may voluntarily dismiss his action before trial because it lacks merit, there are other reasons also which may cause a *230plaintiff to terminate the action. But a recognition that there are various reasons which motivate different plaintiffs to voluntarily dismiss actions before trial offers no convincing argument that sound public policy or equity favors the plaintiff to justify denying to defendant an award of attorney’s fees in this situation.
I would reverse the order of the trial court.
Tobriner, J., concurred.
Assigned by the Chairperson of the Judicial Council.