
    PATRIOTCOM, INC., Appellant, v. Richard L. VEGA and Joseph Kohut, Appellees.
    No. 4D01-3688.
    District Court of Appeal of Florida, Fourth District.
    July 31, 2002.
    O.M. Amir, John Wien and Eleanor Weinberger of O.M. Amir & Company, Hallandale Beach, for appellant.
    Brian J. Stack of Stack Fernandez Anderson Harris & Wallace, P.A., Miami, for appellees.
   PER CURIAM.

We reverse the order of dismissal because the trial court went beyond the four corners of the complaint in determining the motion to dismiss. In particular, the trial court considered corporate documents not attached to the complaint and an improperly raised affirmative defense in ap-pellee’s motion to dismiss. It is well settled that it is error for a court to grant a dismissal based upon factual evidence not contained in, and contradictory to, the complaint’s allegations. See Barbado v. Green & Murphy, P.A., 758 So.2d 1173, 1174 (Fla. 4th DCA 2000). It is also well settled that an affirmative defense cannot be raised in a motion to dismiss, unless the defense appears upon the face of a prior pleading. See id.; accord Ramos v. Mast, 789 So.2d 1226, 1227 (Fla. 4th DCA 2001). Here, the motion to dismiss asserted a defense, lack of authority to bring the action, that had not been pled, did not appear on the face of the complaint, and was contrary to the complaint’s allegations. See Beach Roundhouse Town Corp. v. Skinner, 356 So.2d 881, 881-82 (Fla. 3d DCA 1978).

Reversed.

WARNER, GROSS and HAZOURI, JJ., concur.  