                 FOR PUBLICATION
 UNITED STATES COURT OF APPEALS
      FOR THE NINTH CIRCUIT

RAMON GAMA PUGA,                      
              Petitioner-Appellant,
                v.
                                           No. 05-16902
MICHAEL CHERTOFF, Secretary,
Department of Homeland Security;            D.C. No.
                                          CV-05-03607-JF
NANCY ALCANTAR, Field Office
Director, Immigration and                   OPINION
Customs Enforcement; ALBERTO R.
GONZALES, Attorney General,
            Respondents-Appellees.
                                      
       Appeal from the United States District Court
          for the Northern District of California
         Jeremy Fogel, District Judge, Presiding

                  Argued and Submitted
       February 12, 2007—San Francisco, California

                    Filed May 24, 2007

    Before: J. Clifford Wallace, Dorothy W. Nelson, and
          M. Margaret McKeown, Circuit Judges.

               Opinion by Judge McKeown




                           6205
                   GAMA PUGA v. CHERTOFF                  6207


                         COUNSEL

James Todd Bennett, El Cerrito, California, for the petitioner-
appellant.
6208                GAMA PUGA v. CHERTOFF
Edward A. Olsen, United States Department of Justice,
United States Attorney’s Office, San Francisco, California;
Papu Sandhu, United States Department of Justice, Office of
Immigration Litigation, Washington, D.C., for the
respondents-appellees.


                          OPINION

McKEOWN, Circuit Judge:

   Ramon Gama Puga, a native and citizen of Mexico, appeals
the district court’s dismissal of his habeas petition for lack of
jurisdiction under the REAL ID Act, Pub. L. No. 109-13,
§ 106(a), 119 Stat. 231, 310-11 (May 11, 2005). The district
court held that the Act “designates [a] petition for review in
the appellate courts as the sole means for challenging a final
order of removal, and Gama Puga has not demonstrated that
this remedy is inadequate or ineffective.” Gama Puga argues
that he suffered ineffective assistance of counsel before and
during the removal proceedings in violation of his Fifth
Amendment due process rights, and that to the extent § 106(a)
of the REAL ID Act precludes habeas review of his claim,
§ 106(a) is unconstitutional.

   Although Gama Puga raises an important jurisdictional
question about the effect of the REAL ID Act on district
courts’ habeas jurisdiction over ineffective assistance of coun-
sel claims brought by alien petitioners, we need not reach that
issue here. Instead, we affirm the district court on the grounds
that Gama Puga failed to exhaust the administrative remedies
that were available to him, and thus his claim was not prop-
erly before the district court. See Moreno v. Baca, 431 F.3d
633, 638 (9th Cir. 2005) (“We may affirm the district court
on any basis supported by the record.”); Sinochem Int’l Co.
Ltd. v. Malaysia Int’l Shipping Corp., 127 S. Ct. 1184, 1193-
94 (2007) (holding that a federal court may dismiss an action
                          GAMA PUGA v. CHERTOFF                          6209
on the basis of a threshold, nonmerits issue without first
definitively determining whether it has jurisdiction over the
case).

                                BACKGROUND

   In 1990, Gama Puga entered the United States at the age of
sixteen. He is married and has five U.S. citizen children. In
2001, Gama Puga’s first lawyer advised him to file an asylum
application for the sole purpose of triggering a removal pro-
ceeding, at which point Gama Puga could apply for cancella-
tion of removal under 8 U.S.C. § 1229b(b)(1).1 In executing
this ultimately unsuccessful plan, Gama Puga’s first lawyer
filed a bare-bones asylum application on behalf of Gama Puga
that simply stated, “[i]f I were to return to Mexico, I would
not be able to survive there.” The lawyer did not file any sup-
porting documents with the asylum application.

  After his asylum interview, Gama Puga was placed in a
  1
   Section 1229b(b)(1) states:
      The Attorney General may cancel removal of, and adjust to the
      status of an alien lawfully admitted for permanent residence, an
      alien who is inadmissible or deportable from the United States if
      the alien—
      (A) has been physically present in the United States for a con-
      tinuous period of not less than 10 years immediately preceding
      the date of such application;
      (B) has been a person of good moral character during such
      period;
      (C) has not been convicted of an offense under section
      1182(a)(2), 1227(a)(2), or 1227(a)(3) of this title, subject to para-
      graph (5); and
      (D) establishes that removal would result in exceptional and
      extremely unusual hardship to the alien’s spouse, parent, or child,
      who is a citizen of the United States or an alien lawfully admitted
      for permanent residence.
8 U.S.C. § 1229b(b)(1).
6210                 GAMA PUGA v. CHERTOFF
removal proceeding. During a hearing before the Immigration
Judge (“IJ”), Gama Puga withdrew his asylum application and
applied for cancellation of removal under 8 U.S.C.
§ 1229b(b)(1). The IJ found that Gama Puga’s removal would
not result in “exceptional and extremely unusual hardship” to
his U.S. citizen children and denied relief. The Board of
Immigration Appeals (“BIA”) affirmed the IJ’s decision with-
out opinion in a streamlined decision. On October 8, 2004,
Gama Puga filed a petition for review with this court through
his second and current lawyer. We denied Gama Puga’s peti-
tion for review, holding that we lacked jurisdiction to review
denials of discretionary relief. Gama Puga v. Gonzales,
No. 04-75111 (June 20, 2005).

   On September 7, 2005, after the enactment of the REAL ID
Act (May 11, 2005), Gama Puga filed a habeas petition with
the district court, alleging that his first lawyer provided inef-
fective assistance. On the same day, Gama Puga also filed a
motion for an emergency stay of removal. The district court
dismissed Gama Puga’s habeas petition for lack of jurisdic-
tion under the REAL ID Act and denied his motion for a stay
of removal. On the day Gama Puga was scheduled to be
removed, he filed an emergency motion for a stay of removal
with this court. We granted a temporary stay of removal, but
the order was subsequently vacated.

   On November 17, 2005, Gama Puga was removed to Mex-
ico. He now appeals the district court’s denial of his habeas
petition. We have jurisdiction pursuant to 28 U.S.C. §§ 1291
and 2253(a). We retain jurisdiction over a removed alien’s
habeas petition where, as here, the petition was filed before
the removal and there are collateral consequences arising
from the removal.2 See Zegarra-Gomez v. INS, 314 F.3d 1124,
1126-27 (9th Cir. 2003); Handa v. Clark, 401 F.3d 1129,
1132 (9th Cir. 2005).
  2
   Gama Puga now faces a five-year bar against lawful reentry under 8
U.S.C. § 1182(a)(9)(A)(i).
                     GAMA PUGA v. CHERTOFF                     6211
                            ANALYSIS

   [1] The Immigration and Nationality Act contains a
statutorily-mandated administrative exhaustion requirement.
See 8 U.S.C. § 1252(d)(1) (“A court may review a final order
of removal only if . . . the alien has exhausted all administra-
tive remedies available to the alien as of right . . . .”); see also
Sun v. Ashcroft, 370 F.3d 932, 941 (9th Cir. 2004) (holding
that § 1252(d)(1) applies not only to petitioners on direct
review, but also to habeas petitioners). Here, a motion to
reopen was the only remedy available to Gama Puga to bring
his ineffective assistance of counsel claim, and we have held
that a motion to reopen is not an administrative remedy as of
right. See Castillo-Villagra v. INS, 972 F.2d 1017, 1023 (9th
Cir. 1992). Thus, § 1252(d)(1) does not apply in this case.

   [2] Administrative exhaustion can be either statutorily
required or judicially imposed as a matter of prudence. See
Noriega-Lopez v. Ashcroft, 335 F.3d 874, 881 (9th Cir. 2003)
(“Aside from statutory exhaustion requirements, courts may
prudentially require habeas petitioners to exhaust administra-
tive remedies.”). As noted in Laing v. Ashcroft, “[i]f exhaus-
tion is required by statute, it may be mandatory and
jurisdictional, but courts have discretion to waive a prudential
requirement.” 370 F.3d 994, 997 (9th Cir. 2004). Neverthe-
less, “[p]rudential limits, like jurisdictional limits and limits
on venue, are ordinarily not optional.” Castro-Cortez v. INS,
239 F.3d 1037, 1047 (9th Cir. 2001), abrogated on other
grounds by Fernandez-Vargas v. Gonzales, 126 S. Ct. 2422,
2427 & n.5 (2006).

   [3] Courts may require prudential exhaustion if “(1) agency
expertise makes agency consideration necessary to generate a
proper record and reach a proper decision; (2) relaxation of
the requirement would encourage the deliberate bypass of the
administrative scheme; and (3) administrative review is likely
to allow the agency to correct its own mistakes and to pre-
clude the need for judicial review.” Noriega-Lopez, 335 F.3d
6212                GAMA PUGA v. CHERTOFF
at 881 (quoting Montes v. Thornburgh, 919 F.2d 531, 537 (9th
Cir. 1990)). The first and second factors are particularly
salient in this case and weigh in favor of requiring prudential
exhaustion.

   [4] Gama Puga contends that his former counsel provided
ineffective assistance primarily in two respects: the lawyer
filed a frivolous asylum application for the sole purpose of
triggering a removal proceeding, and she failed to advise
Gama Puga of his ineligibility for relief under 8 U.S.C.
§ 1229b(b)(1). Both of these claims relate to attorney conduct
that occurred prior to and during the removal proceeding,
making the BIA the appropriate body to first pass on the
claims in order to generate a proper record for review. See Liu
v. Waters, 55 F.3d 421, 426 (9th Cir. 1995) (“[T]he BIA does
have the authority to reopen cases to fix administratively cor-
rectable procedural errors, even when these errors are failures
to follow due process.”).

   [5] Permitting Gama Puga to present his ineffective assis-
tance of counsel claim for the first time before the district
court would allow him to bypass the administrative scheme
that is in place to deal with claims such as Gama Puga’s. “A
motion to reopen is the procedural vehicle through which a
petitioner may bring, usually for the first time, an ineffective
assistance of counsel claim before the BIA.” Ontiveros-Lopez
v. INS, 213 F.3d 1121, 1123 (9th Cir. 2000); see also Liu, 55
F.3d at 426 (“A petitioner must make a motion for the BIA
to reopen before we will hold that he has exhausted his
claims”); Arreaza-Cruz v. INS, 39 F.3d 909, 912 (9th Cir.
1994); Roque-Carranza v. INS, 778 F.2d 1373, 1373-74 (9th
Cir. 1985).

   [6] In addition, “[b]efore making an ineffective assistance
of counsel claim, an alien generally must comply with proce-
dural requirements established by the BIA in Matter of
                    GAMA PUGA v. CHERTOFF                    6213
Lozada, 19 I. & N. Dec. 637 (BIA 1988), and adopted by this
court.” Iturribarria v. INS, 321 F.3d 889, 900 (9th Cir. 2003).
In Lozada, the BIA held that an alien alleging ineffective
assistance of counsel must: (1) submit an affidavit explaining
in detail the agreement that was entered into with prior coun-
sel regarding legal representation, (2) submit evidence that he
has informed prior counsel of the allegations of ineffective
assistance and provided the attorney with an opportunity to
respond, and (3) if violation of ethical or legal responsibilities
is alleged, file a complaint with proper disciplinary authorities
or explain why such a complaint has not been filed. 19 I. &
N. Dec. at 639.

   [7] In some cases, we have not required strict compliance
with Lozada requirements, especially when the record shows
“a clear and obvious case of ineffective assistance.”
Rodriguez-Lariz v. INS, 282 F.3d 1218, 1227 (9th Cir. 2002);
see also Castillo-Perez v. INS, 212 F.3d 518, 525 (9th Cir.
2000) (noting that “the requirements of Lozada . . . need not
be rigidly enforced” when “an adequate factual basis exists in
the record for an ineffectiveness complaint and . . . the com-
plaint is a legitimate and substantial one”). Although the first
lawyer may have been ill-informed and the consequences of
her representation for Gama Puga dire, we previously held
that this type of lawyering does not necessarily amount to a
due process violation. See Lara-Torres v. Gonzales, 383 F.3d
968, 973-76 (9th Cir. 2004), amended by 404 F.3d 1105 (9th
Cir. 2005); Padilla-Padilla v. Gonzales, 463 F.3d 972, 975-76
(9th Cir. 2006).

   [8] The record here is unclear as to which elements of
Lozada, if any, Gama Puga has satisfied. In the absence of a
developed record on this point, we cannot conclude that this
bare-bones record demonstrates a “clear and obvious case of
ineffective assistance.” Rodriguez-Lariz, 282 F.3d at 1227.
Consequently, because Gama Puga could, and should have,
exhausted his ineffective assistance of counsel claim by filing
6214               GAMA PUGA v. CHERTOFF
a timely motion to reopen with the BIA when he retained new
counsel, his habeas petition was not properly before the dis-
trict court.

  AFFIRMED.
