
232 Cal.App.3d 671 (1991)
283 Cal. Rptr. 515
LONNIE ELMS et al., Plaintiffs and Respondents,
v.
BUILDERS DISBURSEMENTS, INC., Defendant and Appellant.
Docket No. D012470.
Court of Appeals of California, Fourth District, Division One.
July 19, 1991.
*672 COUNSEL
Lewis, D'Amato, Brisbois & Bisgaard, Peter L. Garchie, Philip A. Book and Daniel H. Fogel for Defendant and Appellant.
Gary G. Kreep and R. Jeffrey Coates for Plaintiffs and Respondents.
OPINION
WORK, J.
The issue in this case is whether a defendant who is sued on a contract entitling a successful litigant to attorney's fees under Civil Code[1] section 1717 may recover such fees where the plaintiff's action is dismissed because it was not brought to trial within five years. Because we answer this question in the affirmative, we reverse the post-judgment order denying the motion of defendant, Builders Disbursements, Inc. (Builders), for attorney's fees and costs from plaintiffs, Lonnie and Sharon Elms (the Elms).

BACKGROUND
In October 1983, the Elms, Geodesic Dome Specialists (Geodesic) and Builders agreed that Builders would control and disburse construction loan funds for Geodesic to build a dome house for the Elms. Paragraph 20 of the agreement recites:
"In the event Control [(Builders)] becomes involved in litigation, or should itself initiate suit to enforce any of the terms of this agreement, or employs an attorney in connection with this agreement or litigation arising therefrom, there shall be paid to Control by the Owner [(Elms)] and/or Contractor [(Geodesic)], all expenses of such litigation and reasonable attorney's fees."
*673 In September 1984, the Elms sued Geodesic, Builders, and others for breach of contract and fraud. In this and in an amended complaint, the only cause of action against Builders was for breach of contract.
In September 1989, the trial court denied the Elms's motion for preference and dismissed their action sua sponte (Code Civ. Proc., § 583.360, subd. (a)) "as to the Defendants who appeared in opposition to Plaintiff's motion."[2]
Builders's request for $43,872.54 in attorney's fees pursuant to section 1717, subdivisions (a) and (b)[3] was countered by the Elms moving to tax costs (Cal. Rules of Court, rule 870(b)(1)). The Elms contended Builders was not entitled to fees under section 1717 and the amount of attorney's fees and costs sought was unreasonable.
After hearing the court concluded there was no prevailing party within the provisions of section 1717, subdivision (b), denied Builders's motion for fees and costs and ordered the Elms's motion to tax Builders's fees and costs off calendar as moot.

DISCUSSION
(1) We conclude the trial court erred in determining there was no prevailing party under section 1717.
When it was enacted in 1968, section 1717 defined "prevailing party" as "the party in whose favor final judgment is rendered." Under that version of the statute, the court in Samuels v. Sabih (1976) 62 Cal. App.3d 335 [133 Cal. Rptr. 74], held the defendants were not entitled to attorney's fees after they had succeeded in having the plaintiffs' action dismissed because it was not brought to trial within five years, because the dismissal was not a "final judgment within the meaning of section 1717." (Id. at p. 340.) The court said it sympathized with the defendants' position they were entitled to fees as the *674 successful party, but the law was to the contrary and any change rested with the Legislature. (Id. at p. 338, fn. 2.)
In 1981, apparently in response to Samuels v. Sabih, supra, 62 Cal. App.3d 335,[4] the Legislature amended section 1717 to authorize a determination of the prevailing party "whether or not the suit proceeds to final judgment." The amendment also provided, with exceptions which do not concern us here, that the "prevailing party" was "the party who is entitled to recover costs of suit." (Stats. 1981, ch. 888, § 1, pp. 3399-3400.)
In Nasser v. Superior Court (1984) 156 Cal. App.3d 52 [202 Cal. Rptr. 552], the court held the foregoing language did not mean an award of costs determined the prevailing party, but rather the party who prevailed was entitled to costs. (Id. at pp. 60-61.) The Nasser court also held neither party prevailed in one of the actions, because "the judgment `must be considered good news and bad news as to each of the parties.'" (Id. at p. 60, quoting Kytasty v. Godwin (1980) 102 Cal. App.3d 762, 774 [162 Cal. Rptr. 556].)
In 1987 the Legislature deleted section 1717's "recover costs of suit" language and defined "prevailing party" as "the party who recovered a greater relief in the action on the contract." (Stats. 1987, ch. 1080, § 1, pp. 488-489.) This definition, which has not been amended, applies to Builders's motion for fees in this case. (Bank of Idaho v. Pine Avenue Associates, supra, 137 Cal. App.3d at p. 11.)
Although the parties have not cited and we have found no case interpreting the foregoing definition, the reasoning in Winick Corp. v. Safeco Insurance Co. (1986) 187 Cal. App.3d 1502 [232 Cal. Rptr. 479], which involved the interpretation of "prevailing party" in a different attorney's fee statute, is persuasive. In Winick, the trial court found the defendant was entitled to attorney's fees as the prevailing party, because it successfully obtained a dismissal of the plaintiff's action for failure to serve and return summons within three years (former Code Civ. Proc., § 581a).
The attorney fee statute in Winick was section 3250, which provides for an award of attorney's fees to the prevailing party in an action on a payment bond. "Prevailing party" is not defined in the statute. The court undertook a "`pragmatic inquiry'" into whether the defendant prevailed, and reasoned: "The most Safeco  or any other civil defendant  ordinarily can hope to achieve is to have the plaintiff's claim thrown out completely. This is exactly what happened here.... In any practical sense of the word, the defendant *675 `prevailed.'" (Winick Corp. v. Safeco Insurance Co., supra, 187 Cal. App.3d at p. 1508.) The court also reasoned Safeco was the prevailing party because it obtained all the relief it requested. (Ibid.)
So it is here. Builders obtained all the relief it requested, and the Elms were denied all of their demands. Pragmatically, and legally, Builders was the prevailing party under section 1717 and is entitled to the benefits of its provisions.[5]
Significantly, the Elms do not contend Builders was not the prevailing party. Instead, they contend, because the court criticized Builders for failing to itemize its fees, the court can be deemed to have found Builders did not sustain its burden of proof as to the reasonableness of the fees, "thereby precluding the Court from finding that [Builders] prevailed on the contract."
The Elms put the cart before the horse. The threshold issue is whether Builders prevailed in the action on the contract. If it did, then the court is required to consider the reasonableness of the fees requested. This concern is irrelevant to the issue of whether Builders prevailed.
Moreover, it is clear from the record the court's criticism of Builders was not the basis of its determination no party prevailed. In criticizing Builders the court said:
"[W]hen a court has to determine the reasonableness of fees, there has got to be sufficient information for any judge to evaluate the work that was done, the time that was spent.
"[H]ow in the world can a judge simply because there was a lumping of those fees into a monetary amount arrive at some valued decision as to whether or not they are reasonable." (Italics added.)
Then, without referring to the reasonableness of Builders's fees, the court determined no party prevailed for the purposes of section 1717. The written court order filed states it determined no party prevailed, and does not address the reasonableness of the requested fees. The reasonableness of fees and costs is an issue the trial court must address on remand.


*676 DISPOSITION
The order is reversed as to Builders and the case is remanded for the superior court to determine and award reasonable attorney's fees and costs pursuant to section 1717, and to determine and award Builders reasonable attorney's fees for this appeal. (Morcos v. Board of Retirement (1990) 51 Cal.3d 924, 928-930 [275 Cal. Rptr. 187, 800 P.2d 543].)
Builders shall have costs on appeal.
Kremer, P.J., and Huffman, J., concurred.
NOTES
[1]  All statutory references are to the Civil Code unless otherwise indicated.
[2]  This judgment was affirmed on appeal (D011410, Apr. 11, 1991).
[3]  Section 1717 recites, in relevant part:

"(a) In any action on a contract, where the contract specifically provides that attorney's fees and costs, which are incurred to enforce that contract, shall be awarded either to one of the parties or to the prevailing party, then the party who is determined to be the party prevailing on the contract, whether he or she is the party specified in the contract or not, shall be the party entitled to reasonable attorney's fees in addition to other costs.... [¶]
"(b)(1) The court, upon notice and motion by a party, shall determine who is the party prevailing on the contract for purposes of this section, whether or not the suit proceeds to final judgment.... [T]he party prevailing on the contract shall be the party who recovered a greater relief in the action on the contract. The court may also determine that there is no party prevailing on the contract for purposes of this section ..."
[4]  See Bank of Idaho v. Pine Avenue Associates (1982) 137 Cal. App.3d 5, 15-16 [186 Cal. Rptr. 695].
[5]  Builders also contends the trial court abused its discretion in finding Builders did not prevail under section 1717, when it did prevail under Code of Civil Procedure section 1032 (recovery of costs by prevailing party), subdivision (a)(4): "`Prevailing party' includes ... a defendant in whose favor a dismissal is entered, ..." However, in its formal order the court denied Builders's motion for fees and costs. Accordingly, the court impliedly found Builders did not prevail under Code of Civil Procedure section 1032, subdivision (a)(4).
