
259 S.W.3d 19 (2008)
John R. DOBSON and Samatherith T. Dobson, Plaintiffs/Respondents,
v.
MORTGAGE ELECTRONIC REGISTRATION SYSTEMS, INC./GMAC MORTGAGE CORPORATION, Defendant, and
First National Bank of Arizona, Defendant/Appellant, and
Commonwealth Land Title Ins. Company,
Doering & Associates, P.C., and
Hilton & Hartford, LLC, Defendants.
Nos. ED 89385, ED 89417.
Missouri Court of Appeals, Eastern District, Division One.
March 18, 2008.
Motion for Rehearing and/or Transfer to Supreme Court Denied April 21, 2008.
Application for Transfer Denied August 26, 2008.
*20 Andrew R. Kasnetz, Sandberg, Phoenix & Von Gontard, P.C., Samuel J. Wright, Michael E. Boyd, Kozeny McCubbin, St. Louis, MO, for appellant.
Stanley J. Wallach, Jerome Wallach, The Wallach Law Firm, St. Louis, MO, Gregory P. White, Clayton, MO, for respondents.
KATHIANNE KNAUP CRANE, Presiding Judge.
Defendant, First National Bank of Arizona (FNBA), appeals from the amended judgment of the trial court denying FNBA's motion to set aside a November 6, 2006 default judgment and awarding plaintiffs, John and Samatherith T. Dobson, damages in the amount of $600,000 in their wrongful foreclosure suit against FNBA. *21 FNBA challenges the denial of its motion to set aside the default judgment. We reverse because the trial court lacked subject matter jurisdiction in that the petition failed to state a damage claim for wrongful foreclosure against FNBA. The petition failed to demonstrate that plaintiffs were not in default when the proceedings commenced.

PROCEDURAL BACKGROUND
Plaintiffs filed a petition to recover monetary damages against defendants FNBA, Mortgage Electronic Registration Systems, Inc. (MERS)/GMAC Mortgage Corporation (GMAC), Commonwealth Land Title Ins. Company (Commonwealth), Doering & Associates, P.C., and Hilton & Hartford, LLC. The petition alleged that plaintiffs purchased a property in 2003 in St. Louis County, Missouri; that FNBA provided financing in the amount of $522,000, secured by a Deed of Trust that named Commonwealth as the trustee and provided for the removal and appointment of a successor trustee; that FNBA subsequently sold or transferred the servicing rights to GMAC, which was identified as "Loan Servicer." It further alleged subsequent recordings to reflect the appointment of a successor trustee, the removal of that trustee, and the appointment of another successor trustee. In the spring and summer of 2005, plaintiffs failed to make three mortgage payments, and the property was foreclosed on August 16, 2005. The purchaser at the foreclosure sale was MERS as nominee for GMAC.
The petition concluded that the foreclosure was "wrongful and void" because of defects in the appointment of successor trustees to Commonwealth and in the recording of instruments relating to the appointments; defects in the power of sale; improper invocation of the power of sale by GMAC instead of by the lender; and the successor trustees' lack of power to convey. Plaintiffs sought damages for the loss of their home, public embarrassment, emotional distress, and damage to their creditworthiness.
FNBA was served with the petition, but did not file an answer within thirty days. At the default hearing, plaintiffs introduced evidence on their loss of equity, damage to their creditworthiness, and emotional distress. After the hearing, plaintiffs voluntarily dismissed all defendants except FNBA. The trial court entered a default judgment against FNBA, and awarded damages in the amount of $1.2 million, representing $300,000 for lost equity and appreciation, $600,000 for lost ability to borrow money, and $300,000 for emotional distress.
Ten days later, FNBA filed a motion to set aside the default judgment on the grounds of good cause and meritorious defense. It subsequently filed supplemental motions contending that the trial court lacked subject matter jurisdiction because plaintiffs failed to properly plead a cause of action for wrongful foreclosure in that the petition admitted plaintiffs' defaults in payment, which gave the holder of the Deed of Trust a right to foreclose. After an evidentiary hearing on the motion, the trial court entered a judgment in which it denied the motion to set aside the default judgment for the reason that FNBA failed to establish good cause, but it reduced the damage award to $600,000.

DISCUSSION
FNBA raises three points on appeal. In its first point, it asserts that the trial court lacked subject matter jurisdiction because the petition failed to state a cause of action for wrongful foreclosure against FNBA. It also claims the evidence established its good cause and meritorious defense, and it challenges the sufficiency of the evidence *22 to support the damage award. Because we find the first point dispositive, we do not reach the remaining points.
A default judgment cannot be entered on a petition that fails to state a cause of action. Phillips v. Bradshaw, 859 S.W.2d 232, 234 (Mo.App.1993). If the petition fails to state a cause of action, the trial court has no subject matter jurisdiction, and may take no action except to dismiss it. Id. Because the failure to state a cause of action is a jurisdictional defect, it may be raised at any time during the proceedings. Id.; Harding v. State Farm Mutual Automobile Ins. Co., 448 S.W.2d 5, 7-8 (Mo. banc 1969).
FNBA argues that the petition failed to state a tort claim for wrongful foreclosure because plaintiffs alleged they failed to make mortgage payments, which was a default that gave rise to a right to foreclose, and there can be no tort cause of action for wrongful foreclosure when there is a right to foreclose.[1] We agree. The petition fails to allege that plaintiffs were not in default under the Deed of Trust and therefore fails to state a claim for damages for wrongful foreclosure.
The term "wrongful foreclosure" has been used both in relation to suits in equity as a ground to set aside a sale and suits at law as a ground to recover tort damages. However, what constitutes a "wrongful foreclosure" sufficient to set aside a sale and what constitutes a "wrongful foreclosure" sufficient to recover damages in tort are not the same. This case turns on the required elements for a tort action.
A tort action for damages for wrongful foreclosure lies against a mortgagee only when the mortgagee had no right to foreclose at the time foreclosure proceedings were commenced. Peterson v. Kansas City Life Ins. Co., 339 Mo. 700, 98 S.W.2d 770, 773-75 (1936); Moore v. Moore, 544 S.W.2d 279, 282 (Mo.App.1976); Spires v. Lawless, 493 S.W.2d 65, 72 (Mo. App.1973). If there is a right to foreclose, there can be no tort cause of action for wrongful foreclosure. Peterson, 98 S.W.2d at 773-74; see also Abrams v. Lakewood Park Cemetery Ass'n, 355 Mo. 313, 196 S.W.2d 278, 285-86 (1946); Petring v. Kuhs, 350 Mo. 1197, 171 S.W.2d 635, 639 (1943); Loeb v. Dowling, 349 Mo. 674, 162 S.W.2d 875, 877 (1942). A plaintiff seeking damages in a wrongful foreclosure action must plead and prove that when the foreclosure proceeding was begun, there was no default on its part that would give rise to a right to foreclose. Loeb, 162 S.W.2d at 877; Peterson, 98 S.W.2d at 773; Spires, 493 S.W.2d at 70. A plaintiff must "plead and prove such compliance with the terms of the deed of trust as would avoid lawful foreclosure." Spires, 493 S.W.2d at 71. See also Robert H. Dierker and Richard J. Mehan, Personal Injury and Torts Handbook, 34 Missouri Practice section 55.7 (2007).
When a foreclosure is wrongful because no default giving rise to a right to sell exists, the mortgagor has two remedies: it can let the sale stand and sue at law for damages or it can bring an equitable action to have it set aside. Peterson, 98 S.W.2d at 775. If the mortgagor did have the right to foreclose, but the sale was otherwise void or voidable, then the remedy is a suit in equity to set the sale aside. Id.
Here, plaintiffs did not plead that they were not in default, or that their compliance with the Deed of Trust was sufficient to avoid a lawful foreclosure. To the contrary, *23 they alleged that they failed to make three mortgage payments. They do not dispute that this was a default in their obligations under the Deed of Trust. Rather, they argue that the wrongful acts that they did allege are sufficient to state a cause of action for wrongful foreclosure. However, plaintiffs focus only on cases in which the plaintiff sought to quiet title or set aside a sale due to the defendant's wrongful acts; they do not cite any cases that hold that damages may be recovered for wrongful foreclosure when a plaintiff has not shown that it was not in default. Accordingly, point one is granted.

Conclusion
Because the petition failed to state a tort claim for damages for wrongful foreclosure, the trial court did not have jurisdiction to enter a default judgment thereon. The judgment is reversed.
ROBERT G. DOWD, JR., J., and KENNETH M. ROMINES, J., concur.
NOTES
[1]  FNBA also challenges the petition on the basis that there is no specific allegation of any wrongdoing against it, which is another issue we do not need to reach.
