1. When this case was here before, we held the action to be to redeem a mortgage, and that as such it was barred by the Statute of Limitations. (Taylor v. McLain, 60 Cal. 652.)
On the return of the cause to the court below the complaint was not amended, and it is the law of the case that the complaint is to redeem. On the last trial below the court held that more than four years had elapsed after the maturity of the indebtedness from plaintiff to defendant before this action was commenced.
There was, therefore, no pleading on the part of plaintiff on which the court was huthorized to base its decree quieting the *514plaintiff’s title and possession, and enjoining the defendants from asserting any claim to the premises.
2. The court below also decreed that the defendant was not entitled to maintain “a cross-action at law in ejectment to plaintiff’s action in equity,” etc.
We think that when an action is brought to have a deed absolute in form declared a mortgage and to redeem the same, the defendant, who asserts by cross-complaint that the deed is not a mortgage but a conveyance indefeasible, may ask, and if he maintains his averments by proof (or plaintiff fails to establish his case), is entitled to a judgment for possession of the premises. He seeks “affirmative relief relating to the transaction, upon which the action is 'brought.” (Code Civ. Proc. § 442.) The section is broader and authorizes defendant to file a cross-complaint whenever he seeks affirmative relief “ affecting the property to which the action relates.” This would seem to permit the assertion of a title independent of and paramount to that which the plaintiff had when he executed his deed. Non constat, in the case at bar, so far as appears from the cross-complaint, that the defendant claims to deraign title from the plaintiff.
3. The court erred therefore in refusing to consider the cross-complaint. If on the trial of the issues made by the cross-complaint and the answer thereto, it had appeared that the defendant claimed title only under the deed from plaintiff to Mayes, and that said deed was executed only as security for an indebtedness from plaintiff to defendant, the court below would have been justified in finding that the legal title did not pass from plaintiffs. If a deed absolute in form is given only to secure a debt, it is to be deemed a mortgage as between the parties thereto, and as to subsequent purchasers with notice. (Civ. Code, §§ 2924, 2925.) The sections of the Civil Code, and it was so declared by the code commissioners, were intended to restore the rule laid down in Cunningham v. Hawkins. (Annotated Code, § 2925.) In Cunningham v. Hawkins, 27 Cal. 604, it was held that parol testimony is admissible to prove a deed absolute in form to have been intended as a mortgage, in actions at law as well as in equity.
4. From what has been said above, it follows that the defend*515ant should have had judgment in the court below as to the action to redeem, as the action was barred by the statute, but that the court should have proceeded to try the action in the nature of ejectment.
On the return of the case to the court below, the parties will, of course, have an opportunity to make application for leave to amend their pleadings in such manner as they may he advised, and it will be for that court to deny such applications or to grant them, with or without terms.
Judgment reversed and cause remanded for new trial.