*61 Opinion
This appeal is the second of two appeals resulting from an amended complaint filed on behalf of T.E.D. Bearing Company, plaintiff (hereinafter T.E.D.) against defendants Walter E. Heller & Company (hereinafter Heller) and Lawrence Warehouse Company (hеreinafter Lawrence).
This complaint alleged various counts. After the court sustained demurrers, an order of dismissal was granted by the court in favor of Lawrence, and T.E.D. entered a stipulation for an order of dismissal, allowing Heller $26 in trial costs. 1 On appeal, the trial court’s determination was upheld. The Court of Appeal’s remittitur was filed, and it provided that “It is ordered, adjudged and decreed by the court that the judgment is affirmed. Respondents to recover costs.” Heller’s and Lawrence’s memoranda of costs included attornеy’s fees “from inception of matter to date.” T.E.D. filed a motion to tax costs and the trial court allowed costs as prayed for in Heller’s and Lawrence’s memoranda. Plaintiff T.E.D. appeals. 2
Plaintiff’s first argument is that, where attorneys’ fees are predicated оn contract, recovery must be predicated on that contract and not be given as costs under Code of Civil Procedure section 1021, and the fees must be alleged and demanded in the complaint. Section 1021 reads as follows: “Except as attorney’s feеs 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; but parties to actions or proceedings are еntitled to costs and disbursements, as hereinafter provided.”
Plaintiff is correct in contending that attorneys’ fees which are based on contract rather than on statute cannot be taxed as
costs
under section 1021 of the Code of Civil Procedure
(Genis
v.
Krasne
(1956)
But where attorneys’ fees are awarded pursuant to a statute rather than by contract, they are costs.
(System Inv. Corp.
v.
Union Bank
(1971)
It is clear that Heller and Lawrence predicated their claim to attorneys’ fees in part on contract; that is, they originally relied on certain language in each of their agreements with T.E.D. which required T.E.D. to pay any attorneys’ fees incurred by defendants Heller and Lawrence. 4 Had we had nothing more before us than these contracts, respondents could not properly have recovered attorneys’ fees as costs; respondеnts’ rights would then be based on contract and they would have had to specially plead and prove the attorneys’ fees, which respondents failed to do.
*63 However, section 1717 of the Civil Code provides as follows: “In any action on a contract, where such contract specifically provides that attorney’s fees and costs, which are incurred to enforce the provisions of such contract, shall be awarded to one of the parties, the prevailing party, whether he is the party specified in the contract or not, shall be entitled to reasonable attorney’s fees in addition to costs and necessary disbursements.
“Attorney’s fees provided for by this section shall not be subject to waiver by the parties to any contract which is entered into after the effeсtive date of this section. Any provision in any such contract which provides for a waiver of attorney’s fees is void.
“As used in this section ‘prevailing party’ means the party in whose favor final judgment is rendered.”
The primary purpose of Civil Code section 1717 is to transfer a unilаteral contractual contract right to attorneys’ fees into a reciprocal provision giving the right to recover to
either
party.
(Associated Convalescent Enterprises
v.
Carl Marks & Co., Inc.
(1973)
The legal situation before us is, perhaps, unique in the sense that Civil Code section 1717 has been used in the past to benefit the prevailing party in cases where the prevailing party was not also the party to be benefited by the unilateral contractual provisions granting attorneys’ fees. That is, the cases we have found have generally dealt with the granting of attorneys’ fees to the prevailing party, under Civil Code section 1717, where the contract had granted attorneys’ fees solely to the other contracting party who lost the law suit. But the language of Civil Code section 1717 is not so limited as this. The statute says that attorneys’ fees shall be awarded to “the prevailing party, whether he is the party specified in thе contract or not.” The language of Civil Code section 1717 does not say that attorney fees will be awarded to the party not benefited by the provision granting attorneys’ fees if that party prevails. The language is broader than that, and it awards attorneys’ fees tо “the prevailing party” whether he is the one specified in the contract or whether he was the one to be disadvantaged by the contract. Therefore, in the case before us, while Heller and Lawrence had rights to attorneys’ fees by contract, they аlso had rights to attorneys’ *64 fees by statute—that is, they had rights as the “prevailing” parties under Civil Code section 1717-
Case law is consistent with this view. It has been judicially determined that the “prevailing party’s” rights to attorneys’ fees under section 1717 is a statutory right.
5
(Associated Convalescent Enterprises
v.
Carl Marks & Co., Inc., supra,
T.E.D. argues that Heller and Lawrence waived their rights to attorneys’ fees. The rule of law requiring that attorneys’ fees be specially averred where they are special damages as a function of contract
(Hunt
v.
Smyth
(1972)
T.E.D. contends that the superior court had no jurisdiction to grant attorneys’ fees on appeal, arguing that, for a superior court to hear an application for attorneys’ fees on appeal after judgment has become final, jurisdiction must be conferred on it by the appellate court or by statute. T.E.D. cites
American City Bank
v.
Zetlen
(1969)
The order is affirmed; our remittitur will carry with it authority for the trial court to award to respondents on this appeal, reasonable attorneys’ fees in addition to the usual costs on appeal.
Jefferson, Acting P. J., and Dunn, J., concurred.
Notes
No contention is made on this appeal that the amounts awarded are excessive if jurisdiction existed in the trial court to make any award at all. No issue as to the amount of the fees was tendered in the trial court.
System Inv. Corp. v. Union Bank, reads as follows at page 162: “It is to be noted that in the present case, the attorneys’ fees were awarded pursuant to statute (Civ. Code, § 1717). Other statutes which provide for attorneys’ fees in litigation refer to attorneys’ fees as costs. For example, section 836 of the Code of Civil Procedure, which relates to actions for damages for libel, provides that if the defendant recovers judgment he shall be allowed one hundred dollars ‘to cover counsel fees in addition to other costs’; section 796 of the Code of Civil Procedure, which relates to actions for partition of property, provides for recovery of ‘the costs of partition, including reasonable counsel fees’; and section 1255a of the Code of Civil Procedure, which relates to eminent domain proceedings, provides that recoverable costs include reasonable attorneys’ fees.”
The agreement with Heller states: “All sums so paid or incurred by Factor [all expenses of storing, wаrehousing, insuring, selling, handling, and shipping Borrower’s inventory, and any and all excise, property, sales taxes, etc.] for any of the foregoing and any and all other sums for which Borrower may become liable hereunder and all costs and expenses (including attorneys’ feеs and court costs) which Factor may incur in creating, enforcing or protecting its lien on all rights or remedies under this or any other agreement or in respect of any of the transactions to be had thereunder, until paid by Borrower to Factor with interest at the rate aforesaid shall be so much additional indebtedness owing by Borrower to Factor. . . .” (Italics supplied by appellant.)
A declaration by A. F. Norris, an officer of Lawrence recites: “Said field warehouse storage agreement provides that the said T.E.D. Bearing Company, therein referred to as depositor, agrees to pay all reasonable expenses including attorney’s fees incurred by Lawrence Warehouse Company incident to conducting any warehouse under said agreement and in connection with any litigatiоn in which Lawrence Warehouse Company is a party.”
The facts so recited are not denied by T.E.D.
In Associated Convalescent Enterprises, supra, the “prevailing party” was not the party to be originally benefited by a unilateral provision for attorneys’ fees.
See Roberts v. Brian, supra, at pages 429 and 430. In Zetlen the motion was made in the trial court for counsel fees on appeal after the judgment became final.
Although unnecessary under our holding in this case, we have, out of an excess of caution, included an express direction to that effect in our judgment.
