
459 So.2d 1146 (1984)
Marvin SINGER, Appellant,
v.
FLORIDA PAVING COMPANY, INC., Appellee.
No. 84-1251.
District Court of Appeal of Florida, Third District.
November 27, 1984.
*1147 Samek & Besser, Miami, for appellant.
Kimbrell, Hamann, Jennings, Womack, Carlson & Kniskern and Paul T. Reid, Miami, for appellee.
Before HENDRY, NESBITT and BASKIN, JJ.
BASKIN, Judge.
Finding that Singer's independent claim for damages states a cause of action within the jurisdiction of the circuit court, and that his claim is not barred by principles of res judicata, we reverse the trial court's dismissal of Singer's complaint.
Singer's action was precipitated by Florida Paving Company's failure to pave and drain Singer's driveway properly. When Florida Paving Company completed its work, Singer paid only a portion of the sum due under his contract. As a result, Florida Paving Company brought an action in county court to foreclose its mechanic's lien on the property and to recover damages for breach of contract. Singer filed a counterclaim for damages amounting to less than $1,500 based upon Florida Paving Company's poor workmanship and damage to his property, but the counterclaim was dismissed as untimely filed. Singer then filed an action in circuit court alleging damages in excess of $5,000. Upon Singer's motion, Florida Paving Company's cause of action against Singer was transferred to circuit court to be heard in conjunction with Singer's action against Florida Paving Company. Florida Paving Company responded to the action brought in circuit court by filing a motion to strike and dismiss Singer's complaint. The court granted the motion[*] and this appeal ensued.
*1148 We reject the argument by Florida Paving Company that the jurisdictional amount alleged in the complaint was subject to challenge because it did not allege a jurisdictional amount in excess of $5,000 "in good faith." Richter Jewelry Co. v. Harrison, 147 Fla. 732, 733, 3 So.2d 387, 388 (1941). Although Florida Paving Company urges the correct test for determining jurisdiction, this case turns on the well-established principle that a trial court's ruling on a motion to dismiss is confined to the allegations within the four corners of the complaint. The trial court is required to accept the allegations as true and may not speculate as to the ultimate facts to be proved during trial. Emile v. Florida Power & Light Co., 426 So.2d 1152 (Fla. 3d DCA 1983); Dunnell v. Malone & Hyde, Inc., 425 So.2d 646 (Fla. 3d DCA 1983). In addition, the complaint was not necessarily inherently false and should not have been striken as a sham. Jaruagua Enterprises, Inc. v. Dom, Inc., 339 So.2d 702 (Fla. 3d DCA 1976); Slatko v. Virgin, 328 So.2d 499 (Fla. 3d DCA 1976).
We also reject appellee's contention that res judicata principles bar the filing of Singer's independent claim in circuit court. A party who has failed to interpose a compulsory counterclaim in a lawsuit which remains pending may nevertheless file an independent action on the same claim. Cheezem Development Corp. v. Maddox Roof Service, Inc., 362 So.2d 99 (Fla. 2d DCA 1978), cert. denied, 368 So.2d 1370 (Fla. 1979). Even though a counterclaim has been dismissed with prejudice, it may be refiled as an independent action while the initial lawsuit remains pending. See Travelers Express, Inc. v. Acosta, 397 So.2d 733 (Fla. 3d DCA 1981).
For these reasons, we reverse the trial court's dismissal and remand for further proceedings.
NOTES
[*]  Although the order granting the motion to strike and dismiss the complaint did not specify that it was with prejudice, a dismissal other than for lack of jurisdiction or for improper venue or for lack of an indispensible party operates as an adjudication on the merits. Fla.R.Civ.P. 1.420(b).
