On December 17, 2001, Raushan Akil Murshid, appellee, filed a complaint, pro se, in the Circuit Court for Baltimore City, seeking custody of his minor child. The complaint named Sisandra C. Lewis, appellant, as defendant and mother of the child.
On January 15, 2002, appellant filed an answer to the complaint, a counter-complaint to enforce a foreign order for custody and other relief, and a motion seeking an ex parte order. In her pleadings, appellant alleged that the child was bom in New York City on July 14, 1998; that appellant and the child resided in Florida from December 1998 through the time of filing of the pleadings; and that on November 21, *2022001, the child visited appellee in the District of Columbia and was to be returned to appellant on December 21, 2001, but the child was not returned.
Appellant’s pleadings also recited that she filed an ex parte emergency motion in the Circuit Court for the Ninth Judicial Circuit in and for Orange County, Florida. The record does not reveal the date the motion was filed, except that it was after November 21 and probably after December 17, 2001. By order dated January 8, 2002, the Florida court granted the motion and ordered appellee to return the child to appellant, to remain in the care of appellant pending further order of the court.
In the pleadings filed in Maryland, appellant requested that appellee’s complaint be dismissed and that the Florida order be enrolled in this State. Appellant also moved for an ex parte order awarding her sole legal custody and enforcing the Florida order. Appellant filed an exemplified copy of the Florida order.
By order dated January 18, 2002, the Maryland court, without a hearing, denied appellant’s motion and dismissed the complaint and counter-complaint.
DISCUSSION
Appellant contends that the circuit court erred in dismissing her counter-complaint. We agree.
In the case before us, no motion to dismiss was filed by either party. The court dismissed the complaint and counter-complaint on its own motion, without a hearing. The court apparently acted on the premise that it lacked subject matter jurisdiction. While that may have been true with respect to the relief requested in the complaint, the request for enforcement of the Florida order contained in the counter-complaint could not be determined adversely to appellant on the pleadings.
The issue of subject matter jurisdiction need not be raised by a party, but may be raised by a court, sua sponte, at *203any time. County Council of Prince George’s County v. Butcher, 365 Md. 399, 405 n. 4, 780 A.2d 1137 (2001) (citing Deny v. State, 358 Md. 325, 334, 748 A.2d 478 (2000); Duffy v. Conaway, 295 Md. 242, 254 n. 8, 455 A.2d 955 (1983) (reiterating that subject matter “jurisdiction is a matter which, if noticed, will be addressed by a court even though it was not raised by any of the parties”)); see also Md. Rule 2-322 (establishing lack of jurisdiction over the subject matter as a defense to any claim). In reviewing the trial court’s dismissal of appellant’s counter-complaint, “we must assume the truth of all relevant and material facts that are well pleaded and all inferences which can be reasonably drawn from those pleadings.” Sharrow v. State Farm Mut. Auto. Ins. Co., 306 Md. 754, 768, 511 A.2d 492 (1986); see also Faya v. Almaraz, 329 Md. 435, 443, 620 A.2d 327 (1993); Lubore v. RPM. Assocs., 109 Md.App. 312, 323, 674 A.2d 547 (1996); Bennett Heating & Air Conditioning, Inc. v. NationsBank, 103 Md.App. 749, 757, 654 A.2d 949 (1995), rev’d in part on other grounds, 342 Md. 169, 674 A.2d 534 (1996); Briscoe v. Mayor of Baltimore, 100 Md.App. 124, 128, 640 A.2d 226 (1994). Dismissal is proper only if the facts and allegations, so viewed, fail to afford a claimant relief if proven, or in this case, establish a lack of subject matter jurisdiction. Faya, 329 Md. at 443, 620 A.2d 327. When a trial court fails to state its reasons for granting a motion to dismiss, we will affirm the judgment if our review of the record discloses that the court was legally correct. Briscoe, 100 Md.App. at 128, 640 A.2d 226; see also Valentine v. On Target, 112 Md.App. 679, 681-82, 686 A.2d 686 (1996).
Although the court’s dismissal of appellee’s complaint, in which he requested a decree awarding him custody, is not before us, we see nothing in the record to indicate that the circuit court erred in determining that it did not have jurisdiction to make a child custody determination. Maryland, like all other states and the District of Columbia, has enacted the Uniform Child Custody Jurisdiction Act (“UCCJA”). Md. Code (1999 Repl.Vol.), Fam. Law §§ 9-201 to 9-224. Section 9-204(a) of Maryland’s UCCJA provides that a court of this State has jurisdiction to make a child custody determination *204by initial decree or modification decree if any one of the following requirements is satisfied:
(1) this State (i) is the home state of the child at the time of commencement of the proceeding, or (ii) had been the child’s home state within 6 months before commencement of the proceeding and the child is absent from this State because of the child’s removal or retention by a person claiming custody or for other reasons, and a parent or person acting as parent continues to live in this State;
(2) it is in the best interest of the child that a court of this State assume jurisdiction because (i) the child and the child’s parents, or the child and at least 1 contestant, have a-significant connection with this State, and (ii) there is available in this State substantial evidence concerning the child’s present or future care, protection, training, and personal relationships;
(3) the child is physically present in this State and (i) the child has been abandoned or (ii) it is necessary in an emergency to protect the child because the child has been subjected to or threatened with mistreatment or abuse or is otherwise neglected or dependent; or
(4) (i) it appears that no other state would have jurisdiction under prerequisites substantially in accordance with items (1), (2), or (3) of this subsection or another state has declined to exercise jurisdiction on the ground that this State is the more appropriate forum to determine the custody of the child, and (ii) it is in the best interest of the child that this court assume jurisdiction.
Id. § 9-204(a).
Based on the pleadings, it appears that the only arguable basis for jurisdiction over appellee’s request for relief in the complaint is section 9-204(a)(2), which bases jurisdiction on a “significant connection” to the State. If that argument were made, it would fail, however, because accepting the allegations in the pleadings as true for purposes of review of the order of dismissal, it appears that Florida meets the definition of home *205state.1 We have previously held that, when a child has a home state, jurisdiction cannot be premised on the significant connection test in subsection (a)(2). Harris v. Simmons, 110 Md.App. 95, 107-08, 676 A.2d 944 (1996) (quoting Malik v. Malik, 99 Md.App. 521, 528, 638 A.2d 1184 (1994)).
Appellant, in her counter-complaint, did not seek an original or modified custody decree. Appellant sought recognition and enforcement of the Florida order granting her temporary custody. Again, Maryland’s UCCJA, as well as the federal counterpart, are controlling on this issue. See Md.Code, Fam. Law § 9-213 (entitled “Out-of-state decree — Recognition and enforcement”); 28 U.S.C. § 1738A (2000) (entitled “Full faith and credit given to child custody determinations”).2 Section 9-213 provides in pertinent part that the courts of this State shall enforce an initial decree of a court of another state that was made under factual circumstances meeting the jurisdictional standards of the UCCJA. Md.Code, Fam. Law § 9-213.
Accordingly, appellant would be entitled to the relief sought if the Florida court properly assumed jurisdiction under the UCCJA, and there are no other bars to enforcement. Assuming the allegations set forth in appellant’s pleadings are true, it appears that the trial court erred in dismissing her counter-complaint.
The order issued by the Florida court was in response to appellant’s ex parte emergency motion for temporary custody. *206Appellant’s counter-complaint clearly alleged that Florida’s jurisdiction over the matter was pursuant to the “home state” basis set forth in its version of the UCCJA. As discussed previously in footnote 1, recognition of Florida as the “home state” appears proper, given the fact that the child resided with appellant in Florida continuously from December 1998 until November 2001, when she went to Washington DC for what was supposed to be a month-long visit with appellee. The fact that appellee failed to return the child to appellant at the scheduled time did not preclude the Florida court from asserting “home state” jurisdiction.
Given the Florida court’s proper assertion of “home state” jurisdiction over the child, the trial court’s dismissal of appellant’s counter-complaint would only be proper if there was some other reason, based on the pleadings, to suggest that the Florida decree did not merit recognition and enforcement in Maryland. While there are á variety of reasons why a court with the power to assert jurisdiction over a child custody case should or may decline to do so, there is nothing in the allegations set forth in the pleadings to support a determination by the trial court that the Florida court should have declined to exercise jurisdiction despite its “home state” status.3 Accordingly, the trial court erred in dismissing appellant’s counter-complaint for lack of subject matter jurisdiction.
*207The nature of the Florida custody decree provides two other possible bases for the trial court’s dismissal of appellant’s complaint. If the trial court’s dismissal was premised on either the temporary or ex parte nature of the Florida custody decree, we hold that the allegations do not support such a conclusion.
Section 9-201 of the UCCJA provides definitions for many of the terms used throughout the rest of the subtitle, including ones for “custody determination,” “custody proceeding,” and “decree or custody decree.” Id. § 9-201. Yet within these definitions and other subsections, there is no express indication as to whether the UCCJA is intended to apply to temporary custody proceedings or determinations.
In the absence of an express provision, courts have been left to consider this issue as it arises. At least three courts that have directly addressed the issue have concluded that the UCCJA does apply to temporary orders. See Me Bride v. McBride, 688 So.2d 856, 859 (Ala.Civ.App.1997) (holding that Alabama’s version of the UCCJA applies to temporary custody orders); Kaiser v. McClendon, 230 Kan. 472, 639 P.2d 39 (1982) (holding that the UCCJA applied to a California child custody order granting “temporary” custody of two children to their father); In re B.R.F., 669 S.W.2d 240 (Mo.App.1984) (holding that the UCCJA applied to the enforcement of temporary as well as permanent decrees, reasoning that the failure to enforce a temporary custody order would result in as much instability as the failure to enforce a permanent order).
Although the Maryland Court of Appeals recently declined the opportunity to decide whether a temporary custody decree entered in another state constitutes an “existing decree” under section 9-208 of the UCCJA, Gruber v. Gruber, 369 Md. 540, 801 A.2d 1013 (2002) (refusing to decide the issue on the ground that there was no final judgment and therefore no *208immediately appealable issue), this Court, on three different occasions, has given some indication that the temporary nature of an order would not affect its enforceability. First, in Cronin v. Camilleri, 101 Md.App. 699, 648 A.2d 694 (1994), we held that a Hawaii temporary restraining order granting temporary custody is a “proceeding” under section 9-206. Next, in Hosain v. Malik, 108 Md.App. 284, 671 A.2d 988 (1996), we granted comity to a Pakistani temporary custody order after determining that the Pakistani court had properly applied a “best interests of the child” standard. Finally, in Harris v. Simmons, 110 Md.App. 95, 676 A.2d 944 (1996), we held that a South Carolina temporary custody order based on emergency jurisdiction was enforceable pending trial in Maryland, which was the child’s home state. Although none of these cases directly addressed the issue, we hold, based on the allegations of the parties, that the temporary nature of the Florida order does not prevent recognition by a Maryland court.
The ex parte nature of the order also raises potential obstacles to enforcement given the UCCJA’s requirement that all contestants be given “reasonable notice and opportunity to be heard.” Md.Code, Fam. Law § 9-204. However, based only on the factual allegations set forth in the pleadings, it is impossible for us to determine whether the Florida proceeding complied with the UCCJA’s notice requirements.4 According*209ly, we cannot affirm the trial court’s dismissal of appellant’s counter-complaint.
In addition, based on pleadings filed in this Court, it appears that appellee has entered an appearance in the Florida action and moved to vacate the Florida order. It may be that the Florida order has been vacated or superseded or that it is not enforceable in Maryland for some other reason. Those matters can be determined on remand. We merely hold that it was error for the trial court to dismiss the counter-complaint on its own motion.
ORDER DISMISSING COUNTER COMPLAINT REVERSED. CASE REMANDED TO THE CIRCUIT COURT FOR BALTIMORE CITY FOR FURTHER PROCEEDINGS CONSISTENT WITH THIS OPINION. COSTS TO BE PAID BY APPELLEE.