*445This is the second time that Juan Gerardo Sandoval Lopez has filed suit seeking a judicial declaration of U.S. citizenship under 8 U.S.C. § 1503(a). The first time he sued, the district court concluded that the suit was jurisdictionally barred under the terms of 8 U.S.C. § 1503(a) -namely, because his claim of citizenship had previously been raised, and rejected, in two separate removal proceedings nearly two decades earlier. So when the same suit appeared before the same court a second time, the case was dismissed on res judicata grounds. But that was erroneous. Because in the appeal from the first suit, we affirmed, but on an entirely different ground-namely, because Lopez was not "within the United States" at the time of suit. That jurisdictional failure has been cured in this second suit. Accordingly, we reverse the dismissal of suit on res judicata grounds, and remand for further proceedings.
I.
Lopez's father (Carlos Sandoval) obtained a United States passport in 1991 based on a false Texas birth certificate. In 1994, he admitted to federal immigration authorities, in the presence of his attorney, that in fact he was born in Mexico, not Texas-and that he was not a U.S. citizen. Based on those admissions, federal immigration officials commenced removal proceedings against Lopez, his father, and the rest of their family.
During the removal proceedings, Lopez's father recanted his prior admission. He submitted a motion claiming citizenship for himself, as well as derivative legal status for his entire family, including Lopez, to remain in the United States.
These removal proceedings concluded in 1997. The immigration court found that Lopez's father had used a false birth certificate to obtain a U.S. passport for himself, as well as legal status in the United States for his family. Accordingly, the immigration court issued an order of removal against the entire family, including Lopez. The order was issued in absentia , because the family had returned to Mexico in the meantime.
The district court summarized the 1997 removal proceedings in its decision in Lopez's first § 1503(a) suit, as follows: "On September 23, 1997, deportation proceedings were held to determine Sandoval's and Lopez's citizenship; Sandoval and Lopez failed to appear. At the proceedings, the Court ruled that Sandoval and Lopez were not United States citizens; instead, the Court concluded both were native citizens of Mexico." Sandoval v. Tillerson , 2017 WL 7794606, *1 (S.D. Tex. April 27, 2017).1
In 1998, the following year, Lopez gained re-entry into the United States-this time, by presenting his own false Texas birth certificate. Immigration officials subsequently discovered that that birth *446certificate, too, was false. Accordingly, the immigration court issued an expedited order of removal against Lopez. See Sandoval-Lopez v. Tillerson , 713 F. App'x 255, 257 (5th Cir. 2017) (per curiam) ("In 1998, Lopez presented a false United States birth certificate at the United States border and the INS ordered him to be removed under an Expedited Order of Removal.").
Eighteen years later, in 2016, Lopez was back at it again. This time, he applied for a U.S. passport, once again claiming derivative citizenship based upon his father's U.S. citizenship. The State Department denied his application.
Lopez brought suit, inter alia , under 8 U.S.C. § 1503(a), challenging the denial of his passport by seeking a judicial declaration of citizenship. The district court concluded that it lacked jurisdiction under 8 U.S.C. § 1503(a), because his citizenship had already been resolved in not one, but two prior removal proceedings-expressly referring to both the 1997 and 1998 removal orders against Lopez.
As the district court explained:
In 1997 and 1998, an Immigration Court ruled Plaintiffs to be Mexican nationals and ordered removal. A challenge to DOS's determination that Plaintiffs are not United States citizens is, in essence, a challenge to the Immigration Court's removal order of each respective Plaintiff. The proper route for Plaintiffs to challenge said removal orders is to follow the detailed procedures laid out by Congress in 8 U.S.C. § 1252.... Plaintiffs attempt to circumvent § 1252 's statutory appellate requirements by asserting an 8 U.S.C. § 1503(a) claim. However, 'a party may not use § 1503(a) to frustrate Congress's effort to channel all appeals from removal proceedings-including those in which the alien raised claims of nationality-through 8 U.S.C. § 1252.'
Sandoval , 2017 WL 7794606 at *3-4 (citation omitted) (quoting Ortega v. Holder , 592 F.3d 738, 743-44 (7th Cir. 2010) ).
On appeal, we affirmed, but on a different ground-that only persons "within the United States" may request a judicial declaration of citizenship under 8 U.S.C. § 1503(a). At the time of suit, Lopez was at a port of entry in Brownsville, Texas. We therefore concluded that he was not "within the United States" for purposes of 8 U.S.C. § 1503(a). See Sandoval-Lopez , 713 F. App'x at 258.
Months later, Lopez returned to the United States and brought this second suit under 8 U.S.C. § 1503(a), before the same district court where he filed his first § 1503(a) suit. The government moved to dismiss, inter alia , on the ground that the district court lacked jurisdiction under 8 U.S.C. § 1503(a), for the same reasons that it did in the first suit. Lopez did not respond to the government's motion to dismiss.
The district court held that it was bound to dismiss for lack of jurisdiction on grounds of res judicata. Lopez now appeals again.
II.
When this court affirms a judgment of the district court, but on different grounds than those adopted by the district court, it is the decision of this court, not the district court, that has preclusive effect:
[I]f an appeal is taken preclusion should attach to every ground that is in fact reviewed and affirmed by an appellate court.... As to matters passed over by the appellate court, however, preclusion is not available on the basis of the trial-court decision.... [O]nce an appellate *447court has affirmed on one ground and passed over another, preclusion does not attach to the ground omitted from its decision.
18 CHARLES ALAN WRIGHT, ARTHUR R. MILLER & EDWARD H. COOPER, FEDERAL PRACTICE AND PROCEDURE (JURISDICTION) [hereinafter WRIGHT & MILLER ] § 4421 (3d ed. 1998). See also , e.g. , Dow Chem. v. EPA , 832 F.2d 319, 323 (5th Cir. 1987) ("Dow maintains that it cannot be bound by the district court's decision because this Court affirmed on other grounds. We agree. 'The federal decisions agree that once an appellate court has affirmed on one ground and passed over another, preclusion does not attach to the ground omitted from its decision.' We decline to depart from this accepted rule.") (quoting the 1981 edition of 18 WRIGHT & MILLER § 4421 ).
This conclusion is fatal to the res judicata analysis employed by the district court in this case. For when this court dismisses a case due to failure of one particular jurisdictional element, and the party later cures that jurisdictional defect and brings a new suit, res judicata does not bar the second suit:
There is little mystery about the res judicata effects of a judgment that dismisses an action for lack of subject-matter or personal jurisdiction or for improper venue.... [A] dismissal for lack of jurisdiction or improper venue does not operate as an adjudication on the merits.... [T]he dismissal permits a second action on the same claim that corrects the deficiency found in the first action . The judgment remains effective to preclude relitigation of the precise issue of jurisdiction or venue that led to the initial dismissal.
18 WRIGHT & MILLER § 4436 (emphasis added).2
That is precisely what occurred here. Lopez has cured the jurisdictional defect identified by this court in the first suit, by bringing this second suit while he was "within the United States," as required by 8 U.S.C. § 1503(a).
Accordingly, we reverse and remand for further proceedings.
Lopez now disputes the district court's account. Specifically, he argues-apparently for the first time-that his citizenship was never raised in his 1997 removal proceedings, and that in fact, his father only sought to adjust Lopez's status to lawful permanent residency. The government responds that, even if true, Lopez is collaterally estopped from making this claim (and that, in any event, Lopez's citizenship was certainly raised, and rejected, in the 1998 removal proceedings). We need not, and do not, resolve this dispute in order to reverse the district court's dismissal of his suit on res judicata grounds. On remand, Lopez is welcome to raise this issue, and the government is welcome to raise any arguments it may have in response.
Our court invoked this rule in Baris v. Sulpicio Lines, Inc. , 74 F.3d 567 (5th Cir.), vacated on reh'g en banc , 101 F.3d 367 (5th Cir. 1996). The panel opinion in that case stated: "These dismissals are not considered adjudications on the merits and ordinarily do not, and should not, preclude a party from later litigating the same claim, provided that the specific defect has been corrected." Id. at 571 (citing 1981 edition of 18 Wright & Miller § 4436 ). The panel opinion was subsequently vacated on rehearing en banc. The en banc court ultimately reached the same judgment as the panel, by an equally divided vote and without opinion.
We subsequently articulated the same rule, in dicta, in Blanchard 1986, Ltd. v. Park Plantation, LLC , 553 F.3d 405 (5th Cir. 2008). See id. at 409 n.15 ("Dismissals for lack of jurisdiction 'are not considered adjudications on the merits and ordinarily do not, and should not, preclude a party from later litigating the same claim, provided that the specific defect has been corrected.' ") (quoting Baris , 74 F.3d at 571 (citing 1981 edition of 18 Wright & Miller § 4436 )).