
439 So.2d 153 (1983)
Richard McMILLON
v.
Belinda Joyce HUNTER.
82-85.
Supreme Court of Alabama.
October 7, 1983.
Michael K. Beard and J. William Thomason of Rives & Peterson, Birmingham, for appellant.
Eugene D. Martenson and R. Steven Bullington of Huie, Fernambucq & Stewart, Birmingham, for appellee.
TORBERT, Chief Justice.
The issue presented in this case is whether a third-party complaint can be dismissed with prejudice on summary judgment because it was improperly filed. We reverse the trial court's grant of summary judgment.
*154 The relevant facts are as follows. Appellant was injured in an automobile accident involving appellee. Because of confusion and disagreement between appellant and Allstate Insurance Company, appellee's insurer, over responsibility for appellant's medical treatment, the medical provider's bills were not paid. The medical provider filed suit against appellant and Allstate for payment. Appellant filed a motion to join appellee as a defendant on the ground that she was a necessary party to the lawsuit. At the same time, appellant filed a third-party complaint[1] (labelled as a "cross-claim") against appellee. One month later, the court added the appellee as a party defendant. Appellee subsequently filed a motion to dismiss or, in the alternative, a motion for summary judgment, on the grounds that 1) appellant had improperly filed a "cross-claim" against a person who was not at the time a party to the action from which the cross-claim arose, or 2) appellant had improperly filed a third-party complaint because the claim did not arise out of the same occurrence that is the subject matter of the original complaint. The trial court granted summary judgment for appellee and appellant appealed.
Appellant does not contend that the third-party complaint was proper. See A.R.Civ.P., Rules 13 and 14. Rather, appellant argues that failure to properly file, whether the claim be denominated a cross-claim or third-party complaint, is not a matter for dismissal with prejudice or summary judgment. The trial court's ruling did not adjudicate the merits. Failure to properly join a party before filing a cross-claim or to comply with the occurrence test for a third-party complaint is a defect in jurisdiction, and any judgment as a result abates, but does not bar, the action. Professor Moore explains:
"The tenor of Rule 56 indicates that the summary judgment procedure deals with merits; and that if granted in favor of a claimant it affirmatively adjudges the merits of the claim and if in favor of the defendant the judgment is in bar and not abatement.
"....
"Matter in abatement ... only results in a dismissal of the action without prejudice; or, if the action is not then dismissed, temporarily stays the prosecution thereof or results in a transfer to another forum. The following illustrate matter in abatement: lack of jurisdiction over the subject matter; lack of jurisdiction over the person; improper venue; insufficiency of process; insufficiency of service of process; failure to join an indispensable party; incapacity of a party to sue; prematurity in bringing an action. A dismissal on any one or more of these defenses does not bar a subsequent action in a court of competent jurisdiction."
6 J. Moore, W. Taggart and J. Wicker, Moore's Federal Practice ¶ 56.03 (2d ed. 1976). See also Heyward v. Public Hous. Admin., 238 F.2d 689, 694 (5th Cir.1956). Therefore, a dismissal for failure to join a party is a dismissal without prejudice. Nor does the label of the motion matter; the trial court must decide if the motion presents an opportunity to judge the merits. Only then can a dismissal with prejudice or summary judgment be properly issued. See also A.R.Civ.P., Rule 41(b).
We reverse the trial court's grant of summary judgment and remand this cause so that the trial court can dismiss the third-party complaint without prejudice.
REVERSED AND REMANDED.
MADDOX, FAULKNER, JONES, ALMON, SHORES, BEATTY and ADAMS, JJ., concur.
EMBRY, J., not sitting.
NOTES
[1]  The original third-party complaint was based on appellee's alleged wantonness. After appellee had been joined as a party, appellant amended his third-party complaint by adding a negligence count.
