
395 So.2d 1024 (1981)
Willard M. BRIGGS, Jr.
v.
Ricky G. WOODFIN.
Civ. 2601.
Court of Civil Appeals of Alabama.
March 4, 1981.
*1025 Carl E. Chamblee, Jr. of Chamblee & Chamblee, Birmingham, for appellant.
B. Boozer Downs, Jr. of Davies, Williams & Wallace, Birmingham, for appellee.
HOLMES, Judge.
The Circuit Court of Jefferson County granted defendant's Rule 12(b)(6), ARCP, motion to dismiss. The plaintiff appeals and we reverse and remand.
The plaintiff sued the defendant for assault and battery. The plaintiff's complaint is as follows:
1. On or about the 30th day of June, 1978, the defendant committed an assault and battery on the plaintiff.
WHEREFORE plaintiff demands judgment against the defendant in the sum of $10,000.00 dollars and costs.
The defendant filed a Rule 12(b)(6), ARCP, motion to dismiss for failure to state a claim upon which relief can be granted. Specifically, the defendant in his motion to dismiss alleged that the plaintiff's action for assault and battery arose out of the same transaction or occurrence which was the subject matter of a prior lawsuit between the parties. The prior lawsuit was an action for breach of contract. The plaintiff further alleged that the assault and battery action should have been a compulsory counterclaim in the prior lawsuit and therefore is barred by Rule 13, ARCP.
The trial court, on the basis of the above, granted defendant's motion to dismiss. We note that there is nothing in the record before this court other than what is indicated above.
A motion to dismiss is warranted only when allegations of the complaint itself clearly demonstrate that plaintiff does not have a claim. Lavoie v. Aetna Life & Casualty Co., Inc., Ala., 374 So.2d 310 (1979). Clearly, in this instance, such is not the case.
The proper test of a motion to dismiss, such as we have in this instance, is whether it appears that plaintiff can prove no set of facts in support of claims entitling him to relief. Smith v. Potts, 293 Ala. 419, 304 So.2d 578 (1974).
As indicated, a Rule 12(b)(6) motion to dismiss only encompasses the determination of whether the pleading states a claim upon which relief can be granted. Matters outside the pleadings should not be *1026 considered in deciding whether to grant a Rule 12(b)(6) motion. Hales v. First National Bank of Mobile, Ala., 380 So.2d 797 (1980). In the event matters outside the pleadings are called to the attention of the trial court, as in this instance, the trial court should treat the Rule 12(b)(6) motion as one for summary judgment under Rule 56 and proceed accordingly. Hales v. First National Bank of Mobile, supra; Papastefan v. B & L Construction Co., Ala., 356 So.2d 158 (1978). See Lyons, Alabama Practice, Vol. 1, pp. 175-176. See also, Sims v. Lewis, Ala., 374 So.2d 298 (1979).
The record before us indicates that no affidavits, etc., were presented by either party and therefore it appears to this court that, quite obviously, the trial court did not treat the motion as one for summary judgment nor "proceed accordingly."
In view of the above, this court has no alternative but to reverse and remand the learned and distinguished judge's action granting the motion to dismiss.
We should note, however, that we would be remiss in not attempting to distinguish Slepian v. Slepian, Ala.Civ.App., 355 So.2d 714 (1977), writ denied 355 So.2d 717 (1978), from the instant appeal.
In Slepian, this court held that a trial court could take judicial notice of proceedings pending in the same court where the defendant in a Rule 12(b)(6), ARCP, motion to dismiss asserted that the subject matter of the complaint and the prayer for recovery therein were embraced in motions pending in another civil action before the court. These circumstances are not present in the instant appeal. The prior proceedings alluded to in the defendant's motion to dismiss in the instant appeal were not pending in the Circuit Court of Jefferson County. In fact, that lawsuit was concluded some time ago in Jefferson County and subsequently appealed to this court.
This case is due to be reversed and remanded.
REVERSED AND REMANDED.
WRIGHT, P. J., and BRADLEY, J., concur.
