Plaintiff filed a complaint in Superior Court alleging that defendants had been unjustly enriched by alimony and attorney’s fees previously paid by plaintiff. The court granted summary judgment for the plaintiff. We find the Superior Court lacked jurisdiction, and we reverse.
Carmel Caldwell and Joretta Caldwell, defendant herein, were married 7 July 1974 and separated on 11 May 1984. Joretta filed an action in the District Court of Haywood County seeking alimony without divorce and attorney’s fees. On 5 November 1984, the court entered an order granting Joretta temporary alimony. On 10 July 1986, the District Court awarded permanent alimony and attorney’s fees in favor of Joretta. Carmel Caldwell appealed the District Court’s Judgment of 10 July 1986. Finding that Joretta Caldwell was not a “dependent spouse” as defined by N.C. Gen. Stat. § 50-16.1(3) (1987), this Court reversed the trial court. Caldwell v. Caldwell, 86 N.C. App. 225, 227, 356 S.E.2d 821, 823 (1987). On 12 January 1988, Carmel Caldwell filed a motion seeking a refund of temporary and permanent alimony as well as the attorney’s fees awarded by the Order of 10 July 1986. In March 1988, Carmel was killed in an automobile accident, and on 3 June 1988, the executor of his estate, Dwight Caldwell, plaintiff herein, filed a motion requesting that he be substituted for the decedent. On 29 June 1988, he filed a motion to amend the motion filed 12 January 1988. On 25 August 1988, the court entered an order substituting Dwight Caldwell as a party defendant to the original suit filed in August 1984 and granting his motion to amend the January 1988 motion.
On 29 June 1988, plaintiff Dwight Caldwell filed this action in Haywood County Superior Court. This action, like the motion filed in District Court on 12 January 1988, sought recovery of *382the alimony and attorney’s fees awarded pursuant to the District Court’s Orders of November 1984 and July 1986. Defendant Joretta Caldwell’s attorneys were included as parties defendants in the Superior Court action. Before answering, defendants filed a motion pursuant to Rule 12(b) of the North Carolina Rules of Civil Procedure, requesting dismissal of plaintiff’s suit on the basis that it is the subject of a prior pending action. The defendants raised that issue again in their answer. After further pleadings and motions, the Superior Court granted summary judgment in favor of the plaintiff on 1 February 1990. Defendants appeal.
On appeal defendants contend the trial court erred in entering summary judgment for plaintiff. We agree.
North Carolina follows the rule “that the pendency of a prior action between the same parties for the same cause in a state court of competent jurisdiction abates a subsequent action in another court of the state having like jurisdiction.” Weaver v. Early, 325 N.C. 535, 538, 385 S.E.2d 334, 336 (1989). As our Supreme Court has noted:
[T]he ordinary test for determining whether or not the parties and causes are the same for the purpose of abatement by reason of the pendency of a prior action is whether the two actions present a substantial identity as to parties, subject matter, issues involved, and relief demanded. This rule has been applied not only when there is a prior civil action pending which is identical to the subsequent action but also when there is a prior action in which a party could by motion in the cause achieve what he is attempting to achieve in the subsequent action.
Id. (emphasis added).
In the case below the District Court had subject matter jurisdiction over Joretta Caldwell’s action for alimony without divorce. The court acquired and retained personal jurisdiction over the parties to the suit. In January 1988, plaintiff’s decedent filed a motion in District Court seeking exactly the relief plaintiff subsequently sought in Superior Court, namely,
1. That the court enter judgment in [Carmel Caldwell’s] favor awarding him a refund of both temporary and permanent alimony as was previously ordered by this court.
* ‡ ‡ *
*3833. That [Carmel Caldwell] have and receive a refund of the attorney’s fees paid to the plaintiffs counsel and that he have interest from and after the date of payments until the entering of this Judgment.
On 3 June 1989, plaintiff, as executor of Carmel Caldwell’s estate and the real party in interest, moved in the District Court to be substituted as a party in the pending alimony action. Thus, in the two suits presented there is substantial identity as to parties, subject matter, issues involved, and relief demanded. The rights plaintiff asserted in his action in Superior Court, filed 29 June 1988, may be litigated in the prior, pending action, which thus abates his action in Superior Court.
Despite the identity of relief sought in the two suits, plaintiff contends that the doctrine of prior action pending does not control because Joretta’s attorneys were not parties to the first action in District Court but were named in the second action in Superior Court. Their argument is unavailing. As the Supreme Court noted in Weaver, the doctrine applies when, in the prior action, “a party could by motion in the cause achieve what he is attempting to achieve in the subsequent action.” 325 N.C. at 538, 385 S.E.2d at 336. Both the motion in District Court and the subsequent action in Superior Court requested a refund of attorney’s fees. The plaintiff may by motion in the cause enforce his right to a refund of alimony and attorney’s fees erroneously awarded.
As for. plaintiff’s argument that the doctrine does not apply to the case below because the District Court did not approve his motion to be substituted as party plaintiff until after he had filed suit in Superior Court, it is sufficient to observe that his motion to be substituted correctly noted that “the action herein survives the death of [Carmel Caldwell].” See N.C. Gen. Stat. § 28A-18-1 (1984). The action of plaintiff’s decedent survived, and plaintiff himself invoked the jurisdiction of the District Court by motions before as well as on the date he filed suit in Superior Court. He will not now be heard to assert that the District Court did not have jurisdiction to adjudicate the cause.
Summary judgment for plaintiff is reversed. The cause is remanded to Superior Court for dismissal of the action.
*384Reversed and remanded.
Chief Judge HEDRICK and Judge LEWIS concur.