
    Will B. Dale, plaintiff in error, v. William Hunneman, defendant in error.
    1. Ejectment: rLEADiNfl: evidence. A plaintiff in ejectment must possess a legal estate, and be entitled to the possession of the premises sought to be recovered.
    Under a general denial the defendant may prove an equity, which negatives the plaintiff’s right to the possession.
    2.--: —:—: defense. If a defendant in ejectment seek affirmative relief, such as to enforce a contract which does not give him the right to< the possession, but does give him the right to demand a specific execution of the contract, upon which the right to continue in possession depends, he must plead the facts entitling him to such relief.
    3. Pleading: counter-claim. A counter-claim is an independent cause of action, in which the defendant becomes an actor in-respect to his claim.
    Error to the district court for Platte county. Tried below, before Post, J. The opinion states the facts of the case.
    
      George G. Boivman and Cornelius é Sullivan, for plaintiff in error,
    cited Story’s Equity, Sec. 761. Edwards v. Fry, 9 Kan., 422. Holcomb v. Dowell, 15 Kan., 882. Kirk v. Hamilton, 102 U. S., 68. General denial was. sufficient to admit evidence offered, 2 Nash. PI. & Pr.,_ 1209, 1210. Wintermute v. Montgomery, 11 Ohio State, 442. Crary v. Goodman, 12 N. Y., 266. Richardson v. Steele, 9 Neb., 488. Evidence, if received, would have shown title that would clearly have brought plaintiff in. error within the occupying claimants act. Lémert v., Barnee, 18 Kan., 9.
    
      
      Byron Millett and Marlow & Munger, for defendant in error.
    1. Where the contract itself does not give the right of possession, but such right to possession depends upon the right to a specific performance of the contract, then the facts which entitle the party to such specific performance should be pleaded. Dewey v. Hoag, 15 Barb., 365. Estrada v. Mwphy, 19 Cal., 248. Blum v. Robertson, 24 Cal., 128.' Bruch v. Tucker, 42 Cal,, 346. McCauley r. Fulton, 44 Cal., 355. DuPont v. Davis, 35 Wis., 631. Bliss on Code Pleading, Sec. 351 and note 4.
    2. As to admissibility of evidence to establish rights under occupying claimants act, see Buchanan v. Dorsey, 11 Neb., 373.
   Maxwell, Ch. J.

This is an action of ejectment, the defense being a general denial. Judgment in the court below was rendered in favor of Hunneman, who had been bjr order of court substituted as plaintiff in lieu of Doddridge, the original plaintiff. The errors assigned will be considered in their ■ order.

First. Objection is made to the admission of the deposition of W- B. Doddridge, upon the ground that it was taken in violation of an agreement, etc. The agreement was denied, and it is very clear that no advantage was taken of the plaintiff in taking the deposition, and it is proper evidence, There was therefore no error in its .admission. . ' •

Second. It is urged that the court erred in excluding the testimony of the plaintiff, as to the value of lasting and valuable improvements erected by him on the premises in controversy. It appears from the testimony that, the plaintiff took possession of the premises in the spring - of 1874, under a verbal lease from W. B. Doddridge; that he remained in possession as such tenant until March, 1877, at which time a proposition was made by Doddridge to Dale, offering to sell him the premises for the sum of §1,000, payable in county warrants. This proposition seems to have been accepted, the warrants to be delivered on or before July 1st, 1877. None of the warrants have ever been delivered, nor has the plaintiff paid any sum whatever for said premises. Nor does he now offer to comply with said contract in any manner or form. This being the case, the mere fact that the plaintiff had made valuable improvements upon the premises constituted no defense to an action for the possession. . If his case is within the provisions of the occupying claimants act, he may still apply for relief as to the value of such improvements.

Section 626 of the code provides that: “In an action for the recovery of real property, it shall be sufficient, if the plaintiff state in his petition that he has a legal estate therein, and is entitled to the possession thereof,” etc.

Section 627 provides that: “It shall be sufficient in such action, if the defendant in his answer deny, generally, the title alleged in the petition, or that he withholds the possession, as the case may be; but if he deny the title of the plaintiff, possession of the defendant will be admitted.”

The action of ejectment was originally devised to enable a tenant for years to recover the possession of the demised premises during the term, real actions at that time being confined to freehold estates. Blackstone says: “In order to maintain the action, the plaintiff must, in case of any defense, make out four points before the court, viz: title, lease, entry and ouster. First, He must show k good title in his lessor, which brings the matter of right entirely before the court; then that the lessor being seized or possessed by virtue of such title, did make him the lease for the present term;. Thirdly, That he, the lessee or plaintiff, did enter or take possession in consequence of such lease; and then, lastly, that the defendant ousted or ejected him.” 3 Blacks. Com., 202. The •form of the action was afterwards modified, so as to allow no question to be raised, except that of title and possession. And if the plaintiff was entitled to the possession, he could recover, whether the party in possession had ousted him or not. Under the code, to entitle the plaintiff to recover, he must possess a legal estate in the premises, and must state in his petition that he is entitled to the possession of the premises. Where the facts stated in the petition are denied, the plaintiff to be entitled to recover, must prove that he possesses a legal estate in the premises, and is entitled to the possession of the same. If the defendant possesses an equity which negatives the plaintiff’s right of possession, such equity may be proved under a general denial, as it is a mere defense to the action. But if the defendant seek affirmative relief, such as to enforce a contract which does not give him the right of possession, but does give him a right to demand a specific execution of the contract by the plaintiff, upon which the right to continue in possession of the premises depends, he must plead- the facts entitling him to such relief. And his answer must contain all the facts necessary to entitle him to such relief. In other words, he may set up in his answer the facts showing him to. have an equitable right to a conveyance from the plaintiff, and if he prove himself equitably the owner, and entitled to the possession, he will not only defeat the action, but obtain affirmative relief. In all eases where affirmative relief is sought by the defendant, the facts entitling him thereto must be set up in the answer. See Bliss on Code Pleading, sections 349-351. Dewey v. Hoag, 15 Barb., 365. Du Pont v. Davis, 35 Wis., 631. Estrada v. Murphy, 19 Cal., 248. Blum v. Robertson, 24 Id., 128, Bruch v. Tucker, 42 Id., 846.

The reason is, a counter-claim is an independent cause of action, in which the defendant becomes an actor in respect to his claim, and it is required to be stated with the same distinctness and certainty as in a petition. The evidence as to the value of the improvements was inadmissible under the pleadings, and was properly excluded. The judgment of the district court is clearly right and is affirmed.

Judgment Affirmed.  