
310 So.2d 326 (1975)
H.E. TEMPLES, D/B/a H.E. Temples Steel Erectors, Appellant,
v.
FLORIDA INDUSTRIAL CONSTRUCTION CO., INC. and Jim Walter Corporation, Appellees.
No. 74-531.
District Court of Appeal of Florida, Second District.
April 2, 1975.
*327 Robert R. McInvale, Tampa, for appellant.
Michael Sierra, Tampa, for appellees.
BOARDMAN, Judge.
Appellant/plaintiff, H.E. Temples, hereafter appellant, timely appeals from the order of the Circuit Court of Hillsborough County granting a motion to dismiss appellant's complaint filed by appellee/defendant, Florida Industrial Construction Co., Inc., hereafter appellee.
The sole issue for our consideration on appeal is whether the order of dismissal was properly rendered by the trial court. Appellant entered into a written subcontract (copy of which was attached to the bill of complaint) to do structural work on a building situate on property of the Jim Walter Corporation. During the course of the work dispute arose between the parties culminating in appellant's filing suit against appellee and Jim Walter Corporation. In Count I of the complaint appellant sought damages arising from the breach of contract and for certain extra work performed in behalf of the appellee. In Count II appellant sought enforcement of a mechanics lien. Appellee moved to dismiss the complaint on the ground that the appellant had executed a waiver of lien, copy of which lien waiver was attached to the motion to dismiss. Jim Walter Corporation filed its motion to dismiss alleging the failure of appellant to comply with the applicable statutory provisions of the Mechanics Lien Law. Appellee filed a request for admissions. Before appellant answered the request, the court granted the motion to dismiss which had been filed by Jim Walter Corporation.[1] The hearing on appellee's motion to dismiss was continued by the court to a later date. After the appellant answered appellee's request for admissions, appellee then filed a second motion to dismiss and alleged two affirmative defenses not apparent on the face of the complaint: (1) Appellant's failure to comply with the conditions precedent before filing the instant action, i.e., failure to pursue the contractual remedy of arbitration; (2) Appellant's execution of a waiver of lien.
After full hearing on the motion to dismiss, the trial court ruled that "... having considered the pleadings on file, the Requested Admissions, and the attachments to the pleadings, and being otherwise advised in the premises, it is therefore, ORDERED... that Plaintiff's Complaint be, and is hereby dismissed with prejudice."
It is well entrenched in our jurisprudence that on a motion to dismiss the movant (appellee) admits as true all the material facts well pleaded. It is axiomatic that in ruling upon a motion to dismiss a complaint the issue before the court is whether the complaint states a valid cause of action. Our examination of the complaint filed in the instant case shows it states a cause of action. Therefore, under the Rules of Civil Procedure, the decision of the trial court in considering matters not disclosed by the complaint constitutes reversible error and we reverse, for unless an affirmative defense appears on the face of a prior pleading, which we submit does not appear in the instant case, it must be raised by pleading, rather than by motion. See RCP 1.110(d) and RCP 1.140(b).[2]
*328 The trial court, as stated above, in its order dismissing the complaint, considered the request for admissions and matters in addition to the complaint. Appellant's answers to the admissions requested by appellee prior to filing its answer to the complaint should have no bearing on the court's consideration of the motion to dismiss. The Supreme Court of Florida, confronted with a similar procedural question in Pizzi v. Central Bank & Trust Co., Fla. 1971, 250 So.2d 895, stated, citing Kest v. Nathanson, Fla.App.4th, 1968, 216 So.2d 233, that "... [t]he court `must confine itself strictly to the allegations within the four corners of the complaint.'... ." There is a clear distinction between motions to dismiss, motions for judgment on the pleadings and motions for summary judgment. A motion to dismiss may not act as a substitute for a motion for summary judgment. See Dawson v. Blue Cross Association, Fla.App.1st, 1974, 293 So.2d 90. This appears to be precisely what took place in the instant case, for, as pointed out, the trial court dismissed the complaint in reliance upon the affirmative defenses raised by appellee in its motion to dismiss and the appellant's admissions.
We submit that this disposition of the case constitutes reversible error, e.g. Davis v. Joyner, Fla.App.4th, 1974, 301 So.2d 803; Daniel v. Department of Transportation, Fla.App.1st, 1972, 259 So.2d 771.
In view of our decision we do not, nor is it necessary, to express an opinion as to the merits of the case, or the result to be reached if appellee moves for judgment on the pleadings or for summary judgment. We think it appropriate to point out to the trial court that in consideration of such motions the court may decide to determine whether appellee has demonstrated that arbitration is a condition precedent which has not been waived by appellee.
Accordingly, we reverse and remand with directions to reinstate appellant's complaint.
McNULTY, C.J., and HOBSON, J., concur.
NOTES
[1]  Appellant does not appeal the court's order dismissing the complaint against Jim Walter Corporation.
[2]  An arbitration clause did appear in the subcontract which was attached to the complaint. It provided only that disputes should be arbitrated as provided in the general contract. The general contract was not made part of the complaint. It is not clear from the subcontractual provision that appellant was barred from bringing an action prior to arbitration.
