
509 So.2d 982 (1987)
CITY OF HAINES CITY, Appellant,
v.
William ALLEN, et Ux., et al., Appellees.
No. 87-182.
District Court of Appeal of Florida, Second District.
July 8, 1987.
Sidney M. Crawford, Sebring, for appellant.
*983 Stephan W. Carter and Roy B. Dalton, Jr., of Dalton and Provencher, P.A., Orlando, for appellees.

ON MOTION TO DISMISS
PER CURIAM.
William Allen and his wife, appellees, have filed a motion to dismiss the appeal of Haines City arguing that the city cannot appeal an adverse summary judgment in a declaratory judgment action until the trial court has disposed of all matters pending before it, including the defendants' counterclaims. We agree and grant the motion to dismiss.
According to the motion and response, William Allen was injured when his automobile was struck by a vehicle driven by Robert Lewis Miller, Jr., who was being pursued by an on-duty Haines City police officer. The Allens notified the city they intended to pursuant a personal injury claim against the city pursuant to section 768.28, Florida Statutes. Before any action was filed by the Allens, Haines City filed a declaratory judgment action asking the circuit court to declare the city's rights with regard to sovereign immunity under section 768.28. The Allens, and the personal representatives of the estates of three other persons killed in the automobile with Allen, were all named as defendants. The defendants answered and filed counterclaims for personal injury and wrongful death.
Both the city and the defendants moved for summary judgment asking the trial court to determine the applicability and effect of section 768.28. The trial court ruled in favor of the defendants holding that section 768.28 does not limit the city's liability to $100,000 but, instead, the city could be liable to the extent of its liability insurance policy limits, in effect, denying the city the defense of sovereign immunity. The trial court entered a "Final Declaratory Judgment" from which the city appealed, but the defendants' counterclaims remain pending.
The city asserts that it filed its declaratory judgment action joining all potential claimants "in an attempt to obviate the need for the defense of multiple claims arising from this incident." The city argues that the trial court's summary judgment is appealable because it resolved the city's original action for declaratory judgment, and is distinct and severable from the defendants' pending counterclaims. The city also argues that judicial economy would be better served by allowing its appeal to continue  if the trial court is reversed then the city can plead sovereign immunity as an absolute defense; if affirmed, the defendants' claims can be resolved in the pending lawsuit.
The Allens argue that under the teachings of S.L.T. Warehouse Co. v. Webb, 304 So.2d 97 (Fla. 1974), the action for declaratory judgment and the counterclaims are interrelated and involved the same occurrence; that the declaratory judgment action is not a distinct and severable branch of the controversy; that the trial court's summary judgment does not end all judicial labors in the cause; that all relevant parties remain in the action; and, that not all the issues between them have been resolved. Therefore, the Allens urge that the city's appeal is premature and should be dismissed. We agree.
A party who seeks a declaratory judgment may join all parties who have or claim any interest which would be affected by the declaration. Section 86.091, Fla. Stat. (1985). A party against whom a declaratory judgment is sought may file a counterclaim, even for damages in tort. Ramirez v. Hardware Dealers Mutual Fire Insurance Co., 170 So.2d 317 (Fla. 3d DCA 1965); see also Travelers Express, Inc. v. Acosta, 397 So.2d 733, 736 (Fla. 3d DCA 1981). If a defendant has a claim against the plaintiff that arises out of the transaction or occurrence that is the subject of the plaintiff's claim, the defendant must plead his claim as a compulsory counterclaim. Fla.R.Civ.P. 1.170(a). If the counterclaim is compulsory, the disposition of it or the main claim cannot be appealed until both have been disposed of. Taussig v. Insurance Company of North America, 301 So.2d 21 (Fla. 2d DCA 1974).
*984 Anticipating several lawsuits, the city sought to have determined early on whether or not it could be sued for personal injury and wrongful death. The city joined as defendants all the parties who had claims against it arising out of the police pursuit incident. The defendants were obliged to file in the same action any claims they had arising out of the police pursuit and subsequent car crash. The question of sovereign immunity and the defendants' tort claims are inextricably intertwined since they arose out of the same incident. The trial court's ruling that the city did not have sovereign immunity did not end the matter. There remained the defendants claims for personal injury and wrongful death. Thus, the decision on the city's declaratory judgment was not an appealable order.
The appellees' motion to dismiss is granted without prejudice to the parties to appeal after all the pending issues have been resolved in the trial court.
Granted.
DANAHY, C.J., and SCHOONOVER and HALL, JJ., concur.
