Donald Davidson filed a complaint against his former employer, Iona-McGregor Fire Protection and Rescue District, alleging that it had violated section 760.10(l)(a), Florida Statutes (1991), by discriminating against him based on a perceived handicap. On Iona-McGregor’s motion, the lower court dismissed the complaint with prejudice. Davidson now seeks review of that dismissal. We reverse, and remand to the trial court to reinstate his suit.
On a motion to dismiss for failure to state a cause of action, a trial court is confined to the four corners of the complaint. The material allegations of the complaint must be taken as true. Cook v. Sheriff of Collier County, 573 So.2d 406, 408 (Fla. 2d DCA 1991). We will, therefore, set out the pertinent parts of Davidson’s amended complaint.
The complaint alleged that when Iona-McGregor hired Davidson as a firefighter, he was required to meet a standard list of conditions. Iona-McGregor added an addendum to these conditions, which stated:
Applicant agrees as a condition of employment, that during his six month probationary period, he will have lost sufficient weight to go from a size 40 waist to a size 36 maximum. Sizes are as measured by Asst. Chief Juntikka.
Davidson asserted that the addendum was added because Iona-McGregor perceived that he was obese. He claimed he lost sufficient weight during his probationary period to satisfy the condition in the addendum. Approximately fifteen months after he was hired, Iona-McGregor’s assistant chief requested that he sign a new agreement to lose weight and to maintain a thirty-six-inch waist size throughout his employment. On at least two occasions, Davidson refused to sign the agreement. Iona-McGregor, however, demanded he reach that waist size, or face termination. Davidson’s amended complaint stated that he met all the state’s requirements to be employed as a firefighter, and all of Iona-McGregor’s requirements, other than his waist size. Iona-McGregor terminated him for failing to maintain a thirty-six-inch waist.
Davidson alleged that Iona-McGregor’s demand that he reach a certain waist size was based on its perception that he was obese. He asserted that obesity is a handicap under the Florida Human Rights Act of 1977 (the “Act”), and that his termination *860violated section 760.10(l)(a), Florida Statutes (1991).
The contentions in Iona-McGregor’s motion to dismiss relevant to this appeal were that Davidson failed to state a cause of action because obesity is not a handicap covered by the Act, that the employment-at-will doctrine precluded his cause of action and that Davidson had failed to exhaust his administrative remedies. After a hearing, the lower court dismissed the complaint, finding that Davidson had signed a written employment agreement, which he incorporated into his complaint, and had failed to abide by its terms. The order stated he had pleaded no other legally sufficient basis for relief.
In his first issue on appeal, Davidson challenges the court’s findings concerning his employment contract. He notes that his complaint asserted that he satisfied the addendum to the contract. On appeal, Iona-McGregor argues that the addendum covered not only the six-month probation period, but was intended to apply to the entire term of Davidson’s employment. We do not know whether this argument was presented to the trial court because we do not have a transcript of the hearing. The court’s conclusion that Davidson failed to abide by the terms and conditions of his employment agreement is, however, a finding of fact not based on the four corners of the complaint. See Cook, 573 So.2d at 408. A motion to dismiss is designed to test the legal sufficiency of a complaint, not to determine fact issues. Lowery v. Lowery, 654 So.2d 1218, 1219 (Fla. 2d DCA 1995); Holland v. Anheuser Busch, Inc., 643 So.2d 621 (Fla. 2d DCA 1994). The dismissal cannot be sustained on the basis stated in the order.
Iona-McGregor, however, contends that we must affirm the lower court’s decision if we can find any valid reason to support it. DSA Group, Inc. v. Gonzalez, 555 So.2d 1234, 1235 (Fla. 2d DCA 1989). It then argues that the complaint failed to state a justiciable claim because obese persons are not handicapped under Florida law. This brings us to Davidson’s second issue on appeal, that the court erred in dismissing his claim because he had properly stated a cause of action for unlawful discrimination.
The Act prohibits an employer from discharging an employee or discriminating against him with respect to the terms of employment based on a handicap, unless the absence of the handicapping condition is necessary based on a bona fide occupational qualification. § 760.10(1), (8), Fla.Stat. (1991). To plead a prima facie case of discrimination, Davidson was required to allege that he was a handicapped person under the law, he was qualified for the position apart from the handicap, and he’was denied employment solely because of the handicap. Brand v. Florida Power Corp., 633 So.2d 504, 510 (Fla. 1st DCA 1994). Davidson’s amended complaint claimed that he met all the requirements for a certified firefighter and was capable of performing the duties. He went on to assert that Iona-McGregor discharged him because it perceived he was obese, and that the perceived obesity is a protected handicap under the statute. The Brand court adopted the definition of a handicap contained in the Rehabilitation Act of 1973. 29 U.S.C. 794 (1994). The United States Supreme Court has ruled that the definition of a handicapped individual includes not only those who are actually physically impaired, but also those who are regarded by others as impaired. School Bd. of Nassau County, Fla. v. Arline, 480 U.S. 273, 281-284, 107 S.Ct. 1123, 1128-1129, 94 L.Ed.2d 307 (1987); see also Cook v. State of R.I., Department of Mental Health, Retardation and Hospitals, 10 F.3d 17 (1st Cir.1993) (allegations of perceived disability state a cause of action under the Rehabilitation Act of 1973). Davidson pleaded a prima facie case of discrimination under Brand. The parties have not cited, nor have we found, a Florida appellate decision stating, as a matter of law, that obesity is not a handicap under the Act. Whether Davidson’s alleged obesity, or perceived obesity, is actually a handicap is a question of fact that cannot be answered on a motion to dismiss. Lowery; Holland.
Iona-McGregor contends on appeal that weight is a bona fide occupational qualification for a firefighter. We first note that this issue was not raised in its motion to *861dismiss. Moreover, a bona fide occupational qualification is an affirmative defense. O’Loughlin v. Pinchback, 579 So.2d 788, 792 (Fla. 1st DCA 1991). While an affirmative defense may be raised by motion when it appears on the face of a prior pleading, our review of the complaint here leads us to the conclusion that Iona-McGregor should have raised this defense in a responsive pleading. Fla.R.Civ.P. 1.100(d), 1.140(b); Lowery. As previously noted, the amended complaint affirmatively alleged that Davidson met all the requirements for a certified firefighter. This allegation must be taken as true on a motion to dismiss.
Finally, Davidson contends that the dismissal cannot be supported by the doctrines of employment-at-will or exhaustion of administrative remedies, grounds raised in Iona-McGregor’s motion to dismiss. We agree. The general rule of at-will employment is that an employee can be discharged, as long as he is not terminated for a reason prohibited by law. Crawford v. David Shapiro & Co., P.A., 490 So.2d 993, 996, n. 4 (Fla. 3d DCA 1986). Davidson’s amended complaint stated he was fired in violation of the Act. As such, whether the employment-at-will doctrine applies cannot be determined at this stage of the proceedings. See Cook, 573 So.2d at 408.
We now turn to whether Davidson exhausted his administrative remedies. Iona-McGregor terminated Davidson on May 8, 1991. The 1991 version of the Act, therefore, applies to this ease. See ch. 92-177, Laws of Fla. (“[t]his act applies only to conduct occurring on or after October 1, 1992”). Section 760.10(10), Florida Statutes (1991), required the injured person to file a complaint with the Human Relations Commission within 180 days of the violation. In the event the Commission failed to conciliate or take final action on the complaint within 180 days, the injured person could bring a civil action against the employer. § 760.10(12), Fla.Stat. (1991). Davidson’s amended complaint pleaded compliance with the statute. Again, taking his allegations as true, which we must, the complaint could not be dismissed on this basis.
Reversed and remanded with directions to the trial court to reinstate Davidson’s suit.
SCHOONOVER and QUINCE, JJ., concur.