This is an action of ejectment to recover possession of a tract of land situate and being in the county of Santa Barbara; damages for the detention thereof and for the value of the rents and profits.
Plaintiff had judgment for possession of the land and four hundred dollars damages. Defendant appeals from the judgment.
The only error assigned is based upon the refusal of the court pending the trial to permit defendant to file an amendment to his answer. The complaint is in the ordinary form of ejectment, and the answer consisted in denials of the allegations of the said complaint.
At the trial, and after plaintiffs had rested their case, defendant sought to prove that plaintiffs’ cattle had ranged and pastured upon his, the said defendant’s, land. Upon an objection being sustained to this and similar evidence, defendant presented and asked to be permitted to file an amendment to his answer, which amendment, omitting the title and merely formal part, is as follows:
*96“ 2. The defendant further alleges that during the times mentioned in the complaint up to 1893, the cattle and stock of plaintiffs ran in common in large numbers with the cattle and stock of defendant on the Rancho San Carlos de Jonata, then and now owned by defendant; that said Rancho San Carlos de Jonata adjoins the lands of plaintiffs, which lands of plaintiffs are part of the Laguna Rancho; that in consequence of the cattle and stock of plaintiffs running and grazing upon the lands of defendant above mentioned, defendant was and has been damaged in the sum of nine thousand dollars.”
Plaintiffs’ counsel objected to the amendment, and the objection was sustained; to which ruling defendant, by his counsel, excepted.
Waiving the fact that this was a jury trial, that the .amendment came after the plaintiffs had closed their case, and that amendments in such cases are within the discretion of the court to grant or refuse, and only subject to revision in cases of an abuse of discretion, and we still perceive no error in the ruling.
The action, as before stated, is one of ejectment. The proposed amendment did not constitute a defense to the action. It was in the nature of a counterclaim for a trespass committed by plaintiffs upon land of defendant contiguous to the demanded premises. A counterclaim may consist of: “ 1. A cause of action arising out of the transaction set forth in the complaint as a foundation of the plaintiff’s claim, or connected with the subject of the action; 2. In an action arising upon contract; any other cause of action arising also upon contract, and existing at the commencement of the action.” (Code Civ. Proc., sec. 438.)
The cause of action, the trespass set up in the amendment, did not, in contemplation of law, arise out of the transaction set forth in the complaint, and was not connected with the subject of the action, and hence is not included in the first ground specified in the statute» It does not come within the second subdivision of sec*97tion 438, for the reason that neither plaintiffs’ cause of action nor defendant’s amendment are causes of action arising upon contract, but are torts, pure and simple. (MacDougall v. Maguire, 35 Cal. 274; 95 Am. Dec. 98; Lovensohn v. Ward, 45 Cal. 8; Demartin v. Albert, 68 Cal. 277; Carpenter v. Hewel, 67 Cal. 589; James v. Center, 53 Cal. 31.)
The case of Story etc. Co. v. Story, 100 Cal. 30, contains a clear exposition of the principles involved in cases arising under the first subdivision of section 438. We recommend that the judgment be affirmed.
Britt, C., and Belcher, C., concurred.
For the reasons given in the foregoing opinion the judgment is affirmed.
Harrison, J., Van Fleet, J., McFarland, J.