
349 So.2d 684 (1977)
Richard B. REED, Selma Reed, His Wife, Hanover Insurance Company, Appellants,
v.
William SAMPSON, Elnora German, Reserve Insurance Company, a Foreign Corporation, Seventh Day Adventist Church, Appellees.
No. 76-1087.
District Court of Appeal of Florida, Fourth District.
August 12, 1977.
*685 Louisa Smith-Adam of Montgomery, Lytal Reiter Denney & Searcy, West Palm Beach, for appellants-Reed and Hanover.
Marjorie D. Gadarian of Jones Paine & Foster, West Palm Beach, for appellee-Seventh Day Adventist Church.
CROSS, Judge.
This is an appeal from a final judgment entered pursuant to an order dismissing with prejudice a third party complaint in an action seeking indemnification and contribution. We reverse.
The genesis of this action arose when William Sampson initiated suit to recover damages for the wrongful death of his son James, who was fatally injured when he was struck by an automobile while crossing a highway during an outing sponsored by the Seventh Day Adventist Church and held at the home of defendants, Richard and Thelma Reed. During the course of pleadings, the Reeds and the insurance company, Hanover, moved to join the Seventh Day Adventist Church as a party defendant. The motion was granted, and the complaint was subsequently amended, adding the church as a party defendant. Plaintiff then settled with the church for seven hundred fifty dollars, and a final judgment was entered for the church based upon a written release executed by plaintiff. The defendants Reeds and Hanover then moved for leave to file a third party complaint against the church seeking contribution from the church and its insurer. The motion was granted and eventually the Reeds and Hanover filed a third party complaint (second amended) against the church and its insurer. The third party complaint alleged that the church had a duty to supervise and had failed to supervise the children attending the activity at the Reeds' home, and as a result, James Sampson was fatally injured. The church then moved to strike and to dismiss the third party complaint based upon a release earlier granted to the church by Sampson. The motion to dismiss was granted, and final judgment for the church was entered. This appeal by the defendants, Reed and Hanover, then followed.
The function of a motion to dismiss a complaint is to raise a question of law as to the sufficiency of the facts alleged to state a cause of action. It is axiomatic that a court may not properly go beyond the four corners of the complaint in testing the legal sufficiency of the allegations set forth therein. Geer v. Bennett, 237 So.2d 311 (Fla.4th DCA 1970). Where a motion to dismiss a complaint rests on facts outside the scope of the allegations contained in the complaint, the trial court commits reversible error in dismissing the complaint based on those extraneous matters. Tiseo v. Arnold, 237 So.2d 21 (Fla.2d DCA 1970).
In the instant case, the third party defendants moved to dismiss the third party complaint upon the grounds that the third party defendant had received a general release from the plaintiff which purported to relieve third party defendants of all future liability. This general release was attached to third party defendant's motion to dismiss as exhibit "A". Thus, the error. The trial court improperly went beyond the four corners of the complaint in testing the legal sufficiency of the complaint to state a cause of action.
Accordingly, the final judgment is vacated and set aside, and the order dismissing the third party complaint with prejudice is reversed and the cause remanded with directions to reinstate the third party complaint and for further proceedings.
Reversed and remanded, with directions.
MAGER, J., and KOVACHEVICH, ELIZABETH A., Associate Judge, concur.
