
    HOUSING AUTHORITY OF ST. LOUIS COUNTY, Plaintiff-Appellant, v. Maurice LOVEJOY, Defendant-Respondent.
    No. 52263.
    Missouri Court of Appeals, Eastern District, Division Three.
    May 26, 1987.
    Motion for Rehearing and/or Transfer Denied June 24, 1987.
    
      Steven W. Garrett, Clayton, for plaintiff-appellant.
    Kayla Vaughn, St. Louis, for defendant-respondent.
   CRANDALL, Judge.

Plaintiff landlord, Housing Authority of St. Louis County (Housing Authority), appeals the dismissal of its unlawful detainer action against defendant tenant, Maurice Lovejoy. We reverse and remand.

In a trial de novo proceeding in the circuit court, defendant filed a motion to dismiss. In the motion, he alleged that Housing Authority failed to plead compliance with federal regulations which require notice and a hearing prior to instituting an eviction action in state court. Defendant argues that such a pleading is an essential element of plaintiff’s cause of action.

We treat defendant’s motion as a motion to dismiss for failure to state a claim. Rule 55.27(a)(6). Since the trial court sustained defendant’s motion without specifying the theory upon which it based its ruling, we presume the dismissal was on the ground alleged in defendant’s motion. Lipton Realty, Inc. v. St. Louis Housing Authority, 705 S.W.2d 565, 568 (Mo.App.1986).

Housing Authority’s third point on appeal is dispositive. In that point, Housing Authority alleges that its petition was sufficient to state a cause of action in unlawful detainer.

The elements of unlawful detainer are found in Section 534.030 RSMo (1986):

[W]hen any person wrongfully and without force, by disseisin, shall obtain and continue in possession of any lands, tenements or other possessions, and after demand made, in writing, for the delivery of the possession thereof by the person having the legal right to such possession, his agent or attorney, shall refuse or neglect to quit such possession, such person shall be deemed guilty of an “unlawful detainer.”

Housing Authority’s petition is a “form” petition which tracks this statute almost verbatim. Housing Authority has adequately pleaded the elements of unlawful detainer in its petition.

Defendant’s position that Housing Authority’s petition is insufficient because Housing Authority neglected to plead it complied “with all applicable federal law and regulation” is untenable. Under Missouri law, failure to comply with applicable federal law is not an element of unlawful detainer which must be pleaded. It is more appropriately an affirmative defense which must be raised by defendant in the manner he chooses. Housing Authority did not have to frame its petition so as to anticipate and negate any affirmative defenses which defendant might raise. The trial court erred in granting defendant’s motion to dismiss on the basis of its failure to plead compliance with the appropriate federal laws.

Finally, we address defendant’s motion to dismiss Housing Authority’s appeal because of Housing Authority’s failure to file a timely notice of appeal. Defendant relies on the fact that Housing Authority’s unlawful detainer action was dismissed on May 27,1986 and notice of appeal was filed on October 2, 1986.

In order for a judgment to be final and appealable it must dispose of all parties and issues in the cause. If a counterclaim is pleaded and submitted, a finding must be made disposing of the counterclaim. Wright v. Martin, 674 S.W.2d 238, 240 (Mo.App.1984). An involuntary dismissal of a plaintiff’s action in which a counterclaim has been filed does not ordinarily operate to dismiss or to discontinue such counterclaim. See Section 510.170 RSMo (1986).

In this case there was a counterclaim that was not dismissed until on September 9, 1986. The judgment of the trial court was not final until 30 days after the dismissal of the counterclaim. Housing Authority’s notice of appeal was filed October 2, 1986 and was clearly timely filed. Defendant’s motion to dismiss Housing Authority’s appeal is denied. We do not reach the issue of whether, in general, a counterclaim is proper in an unlawful detainer proceeding.

The judgment of the trial court is reversed and the case is remanded.

PUDLOWSKI, P.J., and KAROHL, J., concur. 
      
      . 24 C.F.R. Section 966.55 requires the complainant to submit a written request for a hearing to the public housing authority. 24 C.F.R. Section 966.58 provides in pertinent part: "If a tenant has requested a hearing ... in no event shall the notice to vacate be issued prior to the decision of the hearing officer or the hearing panel having been mailed or delivered to the complainant_”
     
      
      . The parties disagree as to whether the trial court sustained a motion to dismiss or a motion for summary judgment. As a consequence, factual assertions are made in the briefs which are not part of the record. We acknowledge that, under some circumstances, a motion to dismiss may be treated as motion for summary judgment. Rule 55.27(b). None of those circumstances are present in this case. There were no supporting affidavits filed and there is no indication that the trial court considered any matters outside the pleadings. Compare Boyer v. Carondelet Sav. & Loan Ass’n., 633 S.W.2d 98, 100 n. 2 (Mo.App.1982). The defendant filed a motion to dismiss. The trial court specified in its order that it was granting defendant’s motion to dismiss. We, therefore, review the trial court's ruling as a ruling on a motion to dismiss.
     
      
      . Defendant's claim on appeal that his counterclaim was not a counterclaim but an affirmative defense is without merit. Defendant denominated it as a counterclaim when he filed it with the trial court and requested as his relief the renewal of his lease. He also denominated it as a counterclaim when he voluntarily dismissed it on September 9, 1986. We accept defendant’s characterization of his pleading for purposes of determining the merits of his motion.
     