Before CLEMENT, OWEN, and HO, Circuit Judges. JAMES C. HO, Circuit Judge:This 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 certificate, 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 court 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.JAMES C. HO, Circuit Judge, concurring:United States citizenship is one of the greatest privileges this world has ever known. So as with anything of great value, the privilege of citizenship must be vigorously protected against fraud and deceit.Take this case. Juan Gerardo Sandoval Lopez brings this suit under 8 U.S.C. § 1503(a), seeking a judicial declaration that he is a U.S. citizen. But federal officials have previously determined—not once, but on three separate occasions, including two different removal proceedings in 1997 and 1998—that any suggestion that Lopez is a U.S. citizen is based on a lie. They concluded that both Lopez and his father submitted false Texas birth certificates in a fraudulent effort to claim that Lopez is a U.S. citizen; that in fact, both men were born in Mexico, not Texas; that neither have otherwise obtained U.S. citizenship; and that both are subject to removal. Those proceedings were resolved over two decades ago. And Lopez never sought judicial review of his removal orders at that time (as he could have done under 8 U.S.C. § 1252).Considering the history of these proceedings, the district court’s summary dismissal of Lopez’s second § 1503(a) suit is understandable. Swift action against citizenship fraud furthers the interests in both protecting the high privilege of citizenship and promoting the rule of law.But in combating citizenship fraud, we must ourselves follow the rule of law. We must be scrupulous, not only in combating false claims of citizenship, but in preventing wrongful deprivations of citizenship as well. Cf. Ng Fung Ho v. White, 259 U.S. 276, 284 (1922) (“To deport one who so claims to be a citizen obviously deprives him of liberty. . . . It may result also in loss of both property and life, or of all that makes life worth living.”).It is in that spirit that I support reversal and remand for further proceedings here, due to the district court’s erroneous res judicata analysis.And it is in that same spirit that I write separately, to address what may occur on remand, in the event we send the case back for further proceedings without further comment: The district court may simply adhere to the jurisdictional analysis it employed in Lopez’s first suit and dismiss this second suit for lack of jurisdiction on precisely the same grounds. As explained below, I believe the jurisdictional issues presented here require greater exploration than what has been provided by counsel in these proceedings to date.To be sure, it may turn out that dismissal of this case is ultimately the correct result, whether on jurisdictional grounds or on the merits. But it is not just the result, but the reasoning, that matters—not just for this case, but for the cases to come.I.On remand, the district court should consider an issue apparently not presented by the parties in these proceedings to date: Does the jurisdictional bar of 8 U.S.C. § 1503(a) apply where, as here, the removal proceedings terminated nearly two decades ago? For purposes of 8 U.S.C. § 1503(a), is Lopez seeking review of a denial of citizenship that arose in a removal proceeding by the immigration court, or in the course of a passport application to the Department of State?The exceptions clause of 8 U.S.C. § 1503(a) states: “[N]o such action may be instituted [under 8 U.S.C. § 1503(a)] in any case if the issue of such person’s status as a national of the United States (1) arose by reason of, or in connection with any removal proceeding under the provisions of this chapter or any other act, or (2) is in issue in any such removal proceeding.” 8 U.S.C. § 1503(a). We have treated this exceptions clause as jurisdictional. See, e.g., Rios-Valenzuela v. Dep’t of Homeland Sec., 506 F.3d 393, 398 (5th Cir. 2007) (“The exception [under § 1503(a)] precludes jurisdiction” over a claim of citizenship where the claim “arose by reason of, or in connection with” a removal proceeding.).[3]The government is well within reason to argue, as an original matter, that the plain text of the jurisdictional bar of § 1503(a) is satisfied here: The issue of Lopez’s status as a U.S. citizen did in fact “ar[i]se by reason of, or in connection with [a] removal proceeding”—indeed, in two separate removal proceedings, in 1997 and 1998. 8 U.S.C. § 1503(a).But Lopez could have responded—and on remand, he might very well contend—that our court has previously rejected this argument (indeed, we have done so with the government’s apparent blessing).In Rios-Valenzuela, our court theorized that the jurisdictional bar of 8 U.S.C. § 1503(a) applies only to pending, not terminated, removal proceedings. To quote:[W]e do not read the exception as forever hanging an albatross around the neck of those who first raise citizenship as a defense in a removal proceeding. So long as a citizenship claim finds its genesis outside of the context of removal proceedings, the exception is no bar to jurisdiction; thus, for example, once removal proceedings have run their full course and terminated, any future citizenship claim would not arise in those removal proceedings. The Government concedes this, explaining that “[i]f Rios- Valenzuela were to again apply for citizenship at some future time, when no removal proceedings have been initiated, and the claim is denied, . . . he would have a right to seek declaratory judgment.” This narrower reading is consistent with the concern that the federal courts not be used as tools to frustrate and interfere with removal proceedings.506 F.3d at 399 (emphasis added). The Seventh Circuit, relying on Rios- Valenzuela, reached the same conclusion. See Ortega v. Holder, 592 F.3d 738, 742-43 (7th Cir. 2010) (same).Perhaps the government, if pressed on remand to respond to such an argument, might offer a different reading of Rios-Valenzuela and Ortega. Or propose a theory for distinguishing those rulings. Or the government might simply disavow its own previous statements and assert that those opinions are incorrect.For example, the government might argue that the opinions are inconsistent with the text of 8 U.S.C. § 1503(a). It could theorize that subclause (2) of the exceptions clause expressly concerns pending removal proceedings—thereby suggesting that subclause (1) must be read to cover terminated removal proceedings. See 8 U.S.C. § 1503(a) (“[N]o such action may be instituted [under 8 U.S.C. § 1503(a)] in any case if the issue of such person’s status as a national of the United States (1) arose by reason of, or in connection with any removal proceeding under the provisions of this chapter or any other act, or (2) is in issue in any such removal proceeding.”).And the government might argue that any language to the contrary in Rios-Valenzuela is strictly dicta, and not binding circuit precedent. In Rios- Valenzuela, this court invoked the jurisdictional bar of § 1503(a) in the context of a pending removal proceeding and dismissed suit for lack of jurisdiction accordingly. Accordingly, the government might argue that Rios-Valenzuela leaves the issue open in this circuit whether § 1503(a) applies where removal proceedings have already long since terminated, as they have here.***These issues warrant careful consideration, particularly in light of the high stakes involved—not just for Lopez, but for others whose claims of citizenship are regarded as dubious by federal officials. We must safeguard the high privilege of citizenship for those lawfully entitled to claim it, while at the same time secure the privilege against fraudulent interlopers. These issues should be considered in the first instance on remand by counsel and the district court. For as we have repeatedly observed, we are a court of review, not first view. I concur.