Spacebox Dover, LLC, seeks a writ of certiorari to quash the circuit court’s order denying its motion to stay a Florida foreclosure action pending the resolution of a Mississippi action on the underlying promissory note. We grant the petition.
Spacebox is one of several defendants in a suit filed by Regions Bank in Mississippi. In the suit, Regions Bank alleged breaches of promissory notes that are secured by real property in Florida. In its answer, Spacebox raised affirmative defenses to the claimed breach and filed a multicount counterclaim. While the Mississippi suit was ongoing, Regions Bank filed a foreclosure suit in Florida based on breach of the same promissory notes. Spacebox responded to the Florida complaint with an answer and affirmative defenses substantially similar to those raised in Mississippi. Regions Bank then assigned its interest in the promissory notes to LSREF2 Baron LLC, which was substituted as plaintiff in the Florida action. Spacebox sought a stay of the Florida action pending a determination of the case in Mississippi. The circuit court denied the stay, and Spacebox challenges this order by petition for certio-rari.
Certiorari relief is warranted when a lower court order departs from the essential requirements of law, causing material harm that cannot be remedied on appeal. Edgar v. Cape Coral Med. Ctr., Inc., 712 So.2d 1209, 1211 (Fla. 2d DCA 1998) (citing Parkway Bank v. Fort Myers Armature Works, Inc., 658 So.2d 646, 648 (Fla. 2d DCA 1995)). An order denying a stay in these circumstances qualifies for certiorari review. Schwartz v. DeLoach, 453 So.2d 454, 455 (Fla. 2d DCA 1984) (“More than once, Florida courts have granted certiorari to quash orders declining to stay cases in favor of prior actions pending in other jurisdictions.”).
This case involves the principle of priority, a matter of comity in which a court in its discretion may stay a pending matter because a substantially similar case is pending in another state’s court, which first acquired jurisdiction. See In re Guardianship of Morrison, 972 So.2d 905, 908 (Fla. 2d DCA 2007). “The purpose ... is to prevent ‘unnecessary and duplicitous lawsuits’ that ‘would be oppressive to both parties.’ ” Id. (quoting Siegel v. Siegel, 575 So.2d 1267, 1272 (Fla.1991)).
Complete identity—of parties or causes of action—is not required for a stay; substantial similarity is sufficient. Id. at 909-10. “[I]t is sufficient that the two actions involve a single set of facts and that resolution of the one case will resolve many of the issues involved in the subsequently filed case.” Id. at 910 (quoting Fla. Crushed Stone Co. v. Travelers Indem. Co., 632 So.2d 217, 220 (Fla. 5th DCA 1994)) (internal quotation marks omitted). That is the situation. here; resolution of the Mississippi action on the promissory notes will resolve many of the issues in the Florida foreclosure action, which is based on the alleged breach of the same promissory notes.
Although the circuit court has discretion when considering a motion for stay, this discretionary power is not without limitation. The stay should be granted unless there are special circumstances, such as *753undue delay by the first court, that warrant the denial of a stay. “Thus, absent any such special circumstances, a trial court abuses its discretion in refusing to grant a stay based on the principle of priority.” Id. at 910 (citing Norris v. Norris, 573 So.2d 1085, 1086 (Fla. 4th DCA 1991)). The circuit court in this case did not find any special circumstances that would justify denying a stay, and we see no evidence of such.
We reject the appellee’s argument that a stay is not warranted because only the Florida court has jurisdiction over the real property. The notes at issue are the same, and the foreclosure on the real property is based on the alleged breach of the notes. See REWJB Gas Invs. v. Land O’Sun Realty, Ltd., 645 So.2d 1055, 1056 (Fla. 4th DCA 1994) (rejecting argument against stay based on exclusive, in rem jurisdiction of second-filed action because the courts had concurrent jurisdiction over contract interpretation, which was the predominant issue in both cases).
The circuit court abused its discretion when denying Spacebox’s motion for stay, and this abuse of discretion is a departure from the essential requirements of law, causing irreparable harm. See Dykes v. Trustbank Sav., F.S.B., 567 So.2d 958, 958-59 (Fla. 2d DCA 1990) (granting cer-tiorari petition and quashing order that refused to stay a foreclosure action pending resolution of a previously filed action in federal court on the same underlying notes and mortgages). We therefore quash the order denying the stay.
Petition granted; order denying stay quashed.
SILBERMAN, C.J., and CRENSHAW, J., Concur.