TERRY, Associate Judge:
In this landlord-tenant case, the tenant appeals from an order striking his pleadings and entering judgment in favor of the landlord because the tenant failed to comply with a protective order. The tenant argues that the trial court erred in failing to consider his assertion that he did not waive his right to a notice to quit, despite the landlord's contrary allegation in the complaint. We agree and reverse.
The landlord sued the tenant for possession of an apartment after the tenant had failed to pay rent for seven months. In the complaint, which was typed on a printed form provided by the court, the landlord checked a box next to a statement that "service of a notice to quit has been specifically waived in writing." On February 3, 1984, the court issued a protective order requiring the tenant to deposit into the registry of the court each month an amount equal to his monthly rent under the lease, which was $325.00. The first such payment was to be made not later than February 6. The tenant filed an answer on February 21 averring that he had not received a "legally sufficient notice to quit" and had not waived in writing his right to such notice.
Although a court may, in its discretion, strike a tenant's pleadings and enter a judgment of possession in favor of a landlord when the tenant fails to comply with a protective order, it may do so only after considering the extent of the tenant's noncompliance and the reasons for it. Battle v. Nash, 470 A.2d 1252, 1254-1255 (D.C. 1983); Davis v. Rental Associates, Inc., 456 A.2d 820, 826-827 (D.C.1983) (en banc). In this case the court properly took these factors into account, but it never made any inquiry into the tenant's allegation that the landlord had misrepresented a fact critical to its suit for possession — namely, that the tenant had waived in writing his right to a thirty-day notice to quit. It merely observed that this asserted "defect" in the complaint would not bar the landlord from obtaining a judgment for possession. In so ruling the court plainly erred.
Appellant was a month-to-month tenant. In the District of Columbia such a tenant is entitled to a thirty-day notice to quit before his landlord may sue for possession of the premises. D.C.Code § 45-1402 (1981). Although service of such a notice may be waived, "it is, nevertheless, a condition precedent to the landlord's suit for possession." Moody v. Winchester Management Corp., 321 A.2d 562, 563 (D.C.1974) (citations omitted); accord, Barr v. Rhea Radin Real Estate, Inc., 251 A.2d 634, 635 n. 7 (D.C.1969). If the landlord fails to serve the tenant with a notice to quit and the tenant does not waive such notice, then the landlord is not entitled to possession. Moody v. Winchester Management Corp., supra. Therefore, if the landlord alleges in a complaint for possession that the tenant has waived the right to a notice to quit, and the tenant contests that allegation, then the landlord must affirmatively prove either that there has been a waiver or that a notice has been served. Because the landlord in this case did neither, it was not entitled to a judgment of possession, regardless of the tenant's failure to comply with the protective order.