
    Appellate Department, Superior Court, Los Angeles
    [Civ. A. No. 14374.
    July 19, 1979.]
    KATHERYN STRICKLAND, Plaintiff and Respondent, v. DELORES BECKS, Defendant and Appellant.
    
      Counsel
    Steven E. Brown for Defendant and Appellant.
    Steven M. West for Plaintiff and Respondent.
   Opinion

IBANEZ, J.

Defendant, tenant, appeals from a judgment in an unlawful detainer action. The only issue on appeal is whether or not the trial court erred in assessing costs. The plaintiff sought to obtain possession of the leased premises based upon the defendant’s failure to pay rent. At the trial the defendant prevailed in her affirmative defense based upon breach of warranty of habitability (Civ. Code, §§ 1940, 1941 & 1942) (see Green v. Superior Court (1974) 10 Cal.3d 616 [111 Cal.Rptr. 704, 517 P.2d 1168]), and the court reduced by 50 percent the amount that otherwise would have been payable as rent. Plaintiff was denied the possession of the leased premises upon payment by the defendant of the amount found due plus costs. " ‘

Costs of $70 claimed by plaintiff were allowed while costs of $58 claimed by defendant were denied. The issue on appeal is whether the court erred in this regard.

Costs were not recoverable at common law. Thus, claims for costs must be based on statute. The measure of the statute is the measure of the right. (Sime v. Hunter (.1921) 55 Cal.App. 157, 159 [202 P. 967]; see 4 Witkin, Cal. Procedure (2d ed. 1971) p. 3242; Cal. Civil Procedure During Trial (Cont.Ed.Bar 1960) p. 611.) Under the applicable California statute it is the “prevailing party” who is entitled to costs. (Code Civ. Proc., § 1031.)

In competing money claims, where one claim offsets the other, the prevailing party is the one in whose favor the net amount is found to be due under the judgment. (Moss Construction Co. v. Wulffsohn (1953) 116 Cal.App.2d 203 [253 P.2d 483].) “Under the pleadings and findings the award to plaintiff’makes it the victor in the contest. Defendants denied owing any sum whatever to plaintiff and sought by way of counterclaim to recover certain damages. Hence, by all rules of logic when at the conclusion of the trial it was determined that plaintiff was entitled to $2,654.29 after allowing defendants a partial offset, it became necessarily the ‘successful party’ within the meaning of that term as used in the contract.” (Id., at p. 205.) See also, Distefano v. Hall (1968) 263 Cal.App.2d 380 [69 Cal.Rptr. 691]; Ecco-Phoenix Electric Corp. v. Howard J. White, Inc. (1969) 1 Cal.3d 266, 273 [81 Cal.Rptr. 849, 461 P.2d 33],

But we do not have before us two competing money claims. Instead, the plaintiff primarily sought the remedy of possession in an unlawful detainer action (Code Civ. Proc., § 1161 et seq.). The defendant, on the other hand, interposed a special defense based on statute. (Civ. Code, § 1940 et seq.) See Green v. Superior Court (1974) 10 Cal.3d 616 [111 Cal.Rptr. 704, 517 P.2d 1168]. Had the plaintiff chosen not to bring an action for unlawful detainer but an action to recover the rent only and defendant had sought damages in a cross-complaint, two competing money claims would have arisen. A net money judgment in favor of one and against the other would have determined who was the prevailing party for the purpose of assessing costs. (Dobbins v. Horsfall (1943) 58 Cal.App.2d 23, 27 [136 P.2d 35].)

Not having competing money claims to use as a basis for determining who is the prevailing party for the purpose of assessing costs, we must look elsewhere. The plaintiff chose the action to be .brought. It was one to obtain possession. This was the primary purpose of plaintiff’s action.

“It is convenient to observe here that the primary purpose of an unlawful detainer action is to obtain the possession, of real property in the cases specified by statute. (Union Oil Co. v. Chandler, 4 Cal.App.3d 716, 721 [84 Cal.Rptr. 756]; Markham v. Fralick, 2 Cal.2d 221, 227 [39 P.2d 804].) The judgment for such possession is enforced by a writ of restitution. (§ 1174.) The judgment, if any, for damages and the rent found due pursuant to section 1174 is a mere incident to the main object—the recovery of possession. (Arnold v. Krigbaum, 169 Cal. 143, 146 [146 P. 423].)” (Gray v. Whitmore (1971) 17 Cal.App.3d 1, 17-18 [94 Cal.Rptr. 904].) The plaintiff was not the prevailing party insofar as the primary purpose of the action which she instituted; the rent found to be due was a “mere incident to the main object,” which was to obtain possession. The defendant, on the other hand, not only prevailed by defeating the plaintiffs claim to possession but she-was successful in establishing her defense based on Civil Code section 1940 et seq.

We conclude that the defendant, and not the plaintiff, was the prevailing party, and the trial court erred in allowing costs to plaintiff and denying them to defendant.

Judgment is reversed and the court is ordered to modify its judgment in accordance with this opinion.

Appellant to recover her costs on appeal.

Dowds, Acting P. J., concurred. 
      
      See Annotation, Who is the “Successful Party” or “Prevailing Party” For Purpose of Awarding Costs . . (66 A.L.R.3d 1115.) - ui
     