                  FOR PUBLICATION
  UNITED STATES COURT OF APPEALS
       FOR THE NINTH CIRCUIT

ETHAN J. HANSEN; JONATHAN J.           
HANSEN,
              Plaintiffs-Appellants,         No. 05-16091
                v.
                                              D.C. No.
                                           CV-04-00322-KJD
DEPARTMENT OF TREASURY; UNITED
STATES INTERNAL REVENUE SERVICE;              OPINION
SOCIAL SECURITY ADMINISTRATION,
            Defendants-Appellees.
                                       
        Appeal from the United States District Court
                 for the District of Nevada
         Kent J. Dawson, District Judge, Presiding

                  Argued and Submitted
              March 8, 2007—Tempe, Arizona

                     Filed May 7, 2007

  Before: Michael Daly Hawkins, Sidney R. Thomas, and
           Richard R. Clifton, Circuit Judges.

                 Opinion by Judge Hawkins




                            5157
             HANSEN v. DEPARTMENT OF TREASURY         5159


                       COUNSEL

Joel F. Hansen (briefed and argued), Hansen & Hansen, LLC,
Las Vegas, Nevada, for the plaintiffs-appellants.

Joan I. Oppenheimer (argued) and Laurie Snyder (briefed),
U.S. Department of Justice, Tax Division, Washington, D.C.,
for the defendants-appellees.


                        OPINION

HAWKINS, Circuit Judge:

  Jonathan J. Hansen (“Hansen”), on behalf of himself and
5160            HANSEN v. DEPARTMENT OF TREASURY
his son, Ethan, appeals the district court’s dismissal of his
complaint for failure to state a claim upon which relief can be
granted. FED. R. CIV. P. 12(b)(6). Hansen’s complaint1
requested: (1) a religious exemption from social security self-
employment tax under 26 U.S.C. (“I.R.C.”) § 1402(g) [herein-
after “§ 1402(g)”]; (2) a declaration that, as applied to Han-
sen, various portions of § 1402(g) violate the First
Amendment’s Free Exercise and Establishment Clauses; (3)
a declaration that he and his son are not required to have or
use a social security number (“SSN”); and (4) a declaration
that “various treasury regulations” are unconstitutional
because they discriminate against Hansen based on his reli-
gious beliefs.

   Concluding that the district court lacked jurisdiction over
Hansen’s statutory and constitutional § 1402(g) claims, we
vacate its Rule 12(b)(6) dismissal of these claims and remand
with directions to enter an order dismissing the claims for lack
of subject matter jurisdiction. We have jurisdiction under 28
U.S.C. § 1291 and affirm the dismissal of Hansen’s remaining
claims.

                          BACKGROUND

   Holding strongly held religious beliefs against having or
using an SSN or being involved in the social security system,
Hansen sought an exemption from self-employment social
security taxes pursuant to § 1402(g). Hansen was denied the
exemption because the Social Security Administration and
Internal Revenue Service determined he did not meet
§ 1402(g)’s eligibility requirements. A United States citizen,
Hansen was also denied an Individual Taxpayer Identification
Number (“ITIN”) because ITINs are available only to individ-
  1
    Although Hansen, an attorney, filed his complaint pro se, he was there-
after represented by counsel.
                HANSEN v. DEPARTMENT OF TREASURY                   5161
uals who are not citizens, nationals, or permanent residents of
the United States. See 26 C.F.R. § 301.6109-1(d)(4).2

   Hansen thereafter filed the complaint at issue, alleging,
inter alia, that he has strong religious beliefs against having
an SSN, that there is no law requiring him or his son “to get
or have a social security number,” and that requiring his son
to have an SSN in order to claim a tax deduction violates the
First Amendment. Hansen’s complaint further alleged that,
“since [he] belongs to an organization that has its own provi-
sions for taking care of its dependent members and has strong
beliefs against having or using a social security number,” he
was entitled to an exemption under § 1402(g) and that “many
of the provisions of [§ 1402(g)] are unconstitutional as they
allow an agency to pick and choose various religions that
‘meet’ the standards and thus, set up an[ ] unfair system of
favoring one group over another, in violation of the First
Amendment.”

   The United States then moved to dismiss, and Hansen
responded with an opposition and a countermotion for sum-
mary judgment. The district court granted the Government’s
motion to dismiss and denied Hansen’s countermotion, as
well as Hansen’s subsequent motion for reconsideration. This
appeal followed.

                   STANDARD OF REVIEW

   Our review of a Rule 12(b)(6) dismissal is de novo and is
limited to the allegations raised in the complaint, which must
be taken as true and construed in the light most favorable to
the nonmoving party. See Knievel v. ESPN, 393 F.3d 1068,
1072 (9th Cir. 2005). Dismissal may be affirmed on any
ground supported by the record, “even if the district court did
  2
   Section 301.6109-1(d)(4) became effective in 1996. Prior to this time,
ITINs were available to those who claimed religious objections to the use
of SSNs. See Miller v. Comm’r, 114 T.C. 511, 514 n.2 (2000).
5162           HANSEN v. DEPARTMENT OF TREASURY
not reach the issue or relied on different grounds or reason-
ing.” Williamson v. Gen. Dynamics Corp., 208 F.3d 1144,
1149 (9th Cir. 2000).

   We also review the district court’s denial of a motion for
summary judgment de novo. Moreno v. Baca, 431 F.3d 633,
638 (9th Cir. 2005). “Viewing the evidence in the light most
favorable to the nonmoving party, [the court] must determine
whether there are any genuine issues of material fact and
whether the district court correctly applied the relevant sub-
stantive law.” Id.

                          ANALYSIS

I.   Hansen’s § 1402(g) Claims

A)     Jurisdiction

   Although the Government did not contest, and the district
court did not address, federal jurisdiction over Hansen’s
§ 1402(g) claims, “[t]he defense of lack of subject matter
jurisdiction cannot be waived,” Augustine v. United States,
704 F.2d 1074, 1077 (9th Cir. 1983), and may “be raised at
any time during the proceedings,” United States v. Bennett,
147 F.3d 912, 914 (9th Cir. 1998) (internal quotations omit-
ted). Furthermore, because federal courts possess “only the
power that is authorized by Article III of the Constitution and
the statutes enacted by Congress pursuant thereto[,] . . . every
federal appellate court has a special obligation to satisfy itself
not only of its own jurisdiction, but also that of the lower
courts in a cause under review,” even if not contested by the
parties. Bender v. Williamsport Area Sch. Dist., 475 U.S. 534,
541 (1986) (internal quotations omitted). If the district court
lacked jurisdiction, “we have jurisdiction on appeal, not of the
merits but merely for the purpose of correcting the error of the
lower court.” Id. (internal quotations omitted).
                 HANSEN v. DEPARTMENT OF TREASURY                      5163
B)    Anti-Injunction Act3

   [1] The Anti-Injunction Act generally bars any suit “for the
purpose of restraining the assessment or collection of any
tax.” I.R.C. § 7421(a). The primary purpose of the Act is to
protect “the Government’s need to assess and collect taxes as
expeditiously as possible with a minimum of pre-enforcement
judicial interference, and to require that the legal right to the
disputed sums be determined in a suit for refund.” Bob Jones
Univ. v. Simon, 416 U.S. 725, 736 (1974) (internal quotations
omitted); Church of Scientology of Cal. v. United States, 920
F.2d 1481, 1484-85 (9th Cir. 1990).

   [2] Although Hansen’s complaint does not specifically seek
an injunction restraining the assessment or collection of tax,
the relief he seeks—a declaration that he qualifies for a
§ 1402(g) exemption or that the portions of § 1402(g) that
render him ineligible for an exemption are unconstitutional—
would “necessarily preclude the collection of” the challenged
tax and therefore falls within the Act’s scope.4 Bob Jones
  3
     The government also challenges Hansen’s standing to raise his
§ 1402(g) claims, contending his complaint fails to allege an “injury-in-
fact” insofar as it does not allege he is self-employed or otherwise subject
to the challenged tax. Nor does the complaint allege that Hansen paid the
tax or that the tax has ever been (or is likely to be) assessed against him.
Because we conclude the Anti-Injunction Act precludes jurisdiction in
federal court, we need not resolve this difficult question. Elias v. Connett,
908 F.2d 521, 523 (9th Cir. 1990) (Anti-Injunction Act governs subject
matter jurisdiction of federal courts); cf. Arizonans for Official English v.
Ariz., 520 U.S. 43, 66-67 (1997) (courts need not address standing first
where other jurisdictional bars apply). We therefore decide this appeal
“under ‘the Anti-Injunction Act because it is relatively straightforward,
avoids deciding a constitutional question (Article III standing), and pro-
vides the narrowest ground for decision.’ ” In re Am. Bicycle Ass’n, 895
F.2d 1277, 1279 (9th Cir. 1990) (quoting In re LaSalle Rolling Mills, Inc.,
832 F.2d 390, 392 n.6 (7th Cir. 1987)).
   4
     Hansen’s complaint does not request that the entirety of § 1402(g) be
declared unconstitutional. Rather, Hansen seeks either to be declared eligi-
ble for a § 1402(g) exemption or a declaration that the portions of the stat-
5164             HANSEN v. DEPARTMENT OF TREASURY
Univ., 416 U.S. at 732; Alexander v. Ams. United, Inc., 416
U.S. 752, 760-61 (1974) (rejecting argument that restraint on
the assessment of taxes was “at best a collateral effect” of a
suit seeking reinstatement of tax-exempt status).

   [3] Accordingly, the Anti-Injunction Act precludes federal
jurisdiction over Hansen’s claims unless he is able to satisfy
the judicially created exception to the Act by demonstrating
(1) irreparable injury if his case is not heard, and (2) certainty
of success on the merits.5 Bob Jones Univ., 416 U.S. at 737;
see also United States v. Lee, 455 U.S. 252, 255 n.2 (1982)
(explaining that, in the tax context, “injunctive relief is to be
granted sparingly and only in exceptional circumstances”).
Under this exception, an injunction can issue only “if it is
clear that under no circumstances could the Government ulti-
mately prevail.” Bob Jones Univ., 416 U.S. at 737.

  [4] Hansen cannot satisfy either prong of this limited
exception. First, dismissing his claim will not result in irrepa-
rable injury because, contrary to his contentions,

ute rendering him ineligible are unconstitutional, thereby entitling him to
an exemption. To the extent Hansen’s complaint can be read as seeking
to have the entire exemption held unconstitutional, he may lack standing
because such a result would not exempt Hansen from participation in the
social security system and therefore would not redress Hansen’s alleged
injury (compelled participation in social security). See, e.g., Patterson v.
Comm’r, 740 F.2d 927, 929-30 (11th Cir. 1984); Templeton v. Comm’r,
719 F.2d 1408, 1412 (7th Cir. 1983); Ward v. Comm’r, 608 F.2d 599, 601
(5th Cir. 1979), cert. denied, 446 U.S. 918 (1980). However, because Han-
sen’s complaint, appellate briefs, and statements made at oral argument
indicate he intends to challenge only those portions that render him ineli-
gible under § 1402(g) with the ultimate goal of obtaining the exemption,
we do not reach this difficult question.
   5
     The various statutory exceptions to the Anti-Injunction Act are not
applicable here. See I.R.C. §§ 6015(e), 6212(a), (c), 6213(a), 6225(b),
6246(b), 6330(e)(1), 6331(I), 6672(b), 6694(c), 7426(a), (b)(1), 7429(b),
7436.
                HANSEN v. DEPARTMENT OF TREASURY                    5165
      This is not a case in which an aggrieved party has no
      access at all to judicial review. . . . [If Hansen] will
      have taxable income . . . , [he] may in accordance
      with prescribed procedures petition the Tax Court to
      review the assessment of income taxes. Alterna-
      tively, [he] may pay income taxes, or, in their
      absence, an installment of FICA or FUTA taxes,
      exhaust the Service’s internal refund procedures, and
      then bring suit for a refund. These review procedures
      offer petitioner a full, albeit delayed, opportunity to
      litigate [his claims].

Bob Jones Univ., 416 U.S. at 746; see, e.g., United States v.
Am. Friend Serv. Comm., 419 U.S. 7, 11 (1974); Alexander,
416 U.S. at 762; Church of Scientology, 920 F.2d at 1489; see
also I.R.C. §§ 6212-13, 7422; 28 U.S.C. § 1346(a)(1).
Although these avenues of relief may not be Hansen’s pre-
ferred route, “[a] taxpayer cannot render an available review
procedure an inadequate remedy at law by voluntarily forgo-
ing it.” Alexander, 416 U.S. at 762 n.13. As such, having
failed to pursue all available remedies, Hansen cannot estab-
lish he will suffer “irreparable harm” if his § 1402(g) claims
are not entertained by the district court.

   [5] Second, Hansen’s success on the merits is anything but
certain. Hansen admits he does not satisfy the plain language
of § 1402(g) because he does not oppose private insurance,
see § 1402(g)(1), instead arguing that this element of
§ 1402(g) is unconstitutional and that the First Amendment
requires he be granted an exemption.6 However, similar First
Amendment challenges to social security tax generally and to
other clauses in § 1402(g) have been consistently rejected by
the courts. See, e.g., Lee, 455 U.S. at 258-61; Droz v.
Comm’r, 48 F.3d 1120, 1123 (9th Cir. 1995) (collecting
  6
   The constitutional nature of Hansen’s § 1402(g) claims is “of no conse-
quence under the Anti-Injunction Act.” Alexander, 416 U.S. at 759; see
also Andersen v. United States, 298 F.3d 804, 809-10 (9th Cir. 2002).
5166             HANSEN v. DEPARTMENT OF TREASURY
cases). While we express no opinion on the merits of Han-
sen’s constitutional claims, we cannot say “it is clear that
under no circumstances could the Government ultimately pre-
vail.” Bob Jones Univ., 416 U.S. at 737.

   [6] Accordingly, the Anti-Injunction Act applies,7 the dis-
trict court lacked jurisdiction to hear Hansen’s § 1402(g)
claims, and dismissal of these claims is required.8 Elias v.
Connett, 908 F.2d 521, 523 (9th Cir. 1990). We therefore
vacate the district court’s Rule 12(b)(6) dismissal of these
claims and remand with direction to dismiss the claims for
lack of subject matter jurisdiction.

II.    Hansen’s Remaining Claims

   Hansen’s complaint also seeks an order declaring that: (1)
he and his son are not required to have or use an SSN, and (2)
“various treasury regulations” unconstitutionally discriminate
against Hansen based on his religious beliefs.9 The district
court dismissed these claims, concluding that although no
statute specifically requires an individual to obtain an SSN,
   7
     Because we conclude that the Anti-Injunction Act removed jurisdiction
from the district court over Hansen’s § 1402(g) claims, we need not decide
whether the Declaratory Judgment Act, 28 U.S.C. § 2201, would also bar
Hansen’s action for declaratory relief regarding § 1402(g). See, e.g., Bob
Jones Univ., 416 U.S. at 732 n.7 (noting that “the federal tax exemption
to the Declaratory Judgment Act is at least as broad as the Anti-Injunction
Act,” but declining to decide whether the Declaratory Judgment Act
barred suit after having decided suit was barred under the Anti-Injunction
Act).
   8
     Because we conclude the district court lacks jurisdiction over Hansen’s
§ 1402(g) claims, Hansen’s appeal from the denial of his countermotion
for summary judgment seeking a § 1402(g) exemption is moot.
   9
     Hansen has standing to bring these claims because his complaint suffi-
ciently alleges an injury-in-fact (compelled use of an SSN), fairly trace-
able to the government’s actions (denying his request for an ITIN), that
is likely to be redressed by a favorable disposition. See Friends of the
Earth, Inc. v. Laidlaw Envtl. Servs. (TOC), Inc., 528 U.S. 167, 180-81
(2000).
                 HANSEN v. DEPARTMENT OF TREASURY                     5167
various statutes and regulations make clear that an SSN is
required and that the government has a compelling interest in
maintaining a sound social security and tax system, and that
the SSN requirement—with its limited exceptions—is nar-
rowly tailored to this interest.

   [7] We affirm the dismissal of these claims because Han-
sen’s complaint fails to specify the particular statutes and reg-
ulations requiring use of an SSN that he objects to, but instead
seeks a general declaration that he and his son are entitled to
never use an SSN and that “various treasury regulations” are
unconstitutional. Without knowing the particular regulations
and statutes to which Hansen objects, it is impossible to gauge
the relevant governmental interest and assess Hansen’s First
Amendment and Equal Protection Clause challenges.10
Accordingly, with respect to these claims, Hansen’s com-
plaint fails to state a claim upon which relief can be granted,
and the district court’s dismissal—albeit on other grounds—
was not in error.

                           CONCLUSION

   For the reasons set forth above, the district court’s order is

 VACATED in part and REMANDED with directions;
AFFIRMED in part. Costs on appeal to Appellees.
  10
     To the extent Hansen’s claim is simply an objection to being assigned
an SSN, his challenge is foreclosed by Bowen v. Roy, 476 U.S. 693
(1986). In Bowen, the Supreme Court rejected a father’s attempt to prevent
the government from assigning his daughter an SSN, reasoning that “[t]he
Free Exercise Clause simply cannot be understood to require the Govern-
ment to conduct its own internal affairs in ways that comport with the reli-
gious beliefs of particular citizens,” and concluding that the father “may
no more prevail on his religious objection to the Government’s use of a
Social Security number for his daughter than he could on a sincere reli-
gious objection to the size or color of the Government’s filing cabinets.”
Id. at 699-700.
