Immigration Habeas Corpus and Mandamus

Immigration · Federal court

Habeas corpus and mandamus petitions

When ICE is holding someone without a lawful basis, or USCIS or a consulate has left a case undecided for too long, a federal judge can be asked to step in.

Immigration · Federal court

Overview

Most immigration cases are decided by USCIS, an immigration judge or a consulate. Two kinds of federal court cases reach past them when the agency itself is the problem. A petition for a writ of habeas corpus asks a federal judge to decide whether a person’s detention is lawful. A petition for a writ of mandamus, usually filed with a claim under the Administrative Procedure Act (APA), asks a federal judge to order an agency to decide a case it has unreasonably delayed.

These cases are filed in U.S. District Court, not in immigration court, and they run alongside the immigration case rather than replacing it. A habeas petition does not decide whether someone can stay in the United States, and a mandamus case does not decide whether an application is approved. Bond hearings before an immigration judge, BIA appeals and petitions for review of removal orders are covered on our removal defense and Immigration Court page.

Both kinds of cases move quickly once filed, and the government is represented by the U.S. Attorney’s Office. Choosing the right court, the right officials to name and the right claims at the start matters, because a mistake there can cost weeks.

Key rules at a glance

  • Habeas corpus: 28 U.S.C. § 2241. Filed in the federal district where the person is detained, naming the officials who hold them.
  • Habeas reviews custody. It is not the way to challenge a removal order itself; that generally goes to the court of appeals by petition for review.
  • Common habeas remedies: an order for a bond hearing before an immigration judge, release on conditions, or a halt to transfer while the court decides.
  • Mandamus: 28 U.S.C. § 1361, usually paired with the APA (5 U.S.C. §§ 555(b) and 706(1)) to compel action unreasonably delayed.
  • The court can order the agency to decide, but not how to decide.
  • Naturalization: if USCIS has not decided an N-400 within 120 days after the interview, 8 U.S.C. § 1447(b) lets the applicant ask the district court to decide it.
  • The government generally has 60 days to respond to a mandamus complaint; in habeas cases the court sets the schedule, often in days.
When each petition fits

How we help

Habeas corpus

  • Held with no bond hearing because ICE or the court says bond is not allowed
  • Prolonged detention with no meaningful review
  • Held after a removal order when removal is not reasonably foreseeable
  • Re-detained after release or at a check-in
  • Emergency motions (TRO) for a prompt hearing or to stop a transfer

Mandamus and APA

  • Green card (I-485) applications far past posted processing times
  • Naturalization (N-400) undecided 120 days after the interview
  • Stalled I-130, I-140, I-751, I-765 and EB-5 I-526E petitions
  • Affirmative asylum (I-589) cases waiting years for an interview
  • Certain consular cases held in administrative processing

Before we file

  • Review the full file for weaknesses, since a faster decision can be a faster denial
  • Collect prior inquiries: USCIS case inquiries, Ombudsman, congressional office
  • Coordinate with any immigration court case so one filing does not harm another
  • Confirm the right court and the right officials to name

The immigration court case

  • Bond hearings before an immigration judge
  • Master calendar and merits hearings
  • Appeals to the BIA
  • Petitions for review in the Ninth and Fifth Circuits
Removal defense and Immigration Court →
Habeas corpus

How a habeas case moves

01

Find the person and the custodian

We confirm where the person is held (the ICE Online Detainee Locator works with an A-number, or a name and country of birth). The petition is filed in that district and names the officials holding them.

Timing: Same day, when possible
02

Review the record

Entry history, prior orders, the Notice to Appear, any bond decision and the detention timeline decide which legal claims fit.

Form: Notice to Appear (I-862), bond orders
03

File the petition and any emergency motion

The petition goes to the U.S. District Court. If the situation is urgent, we ask for a temporary restraining order at the same time, for example for a prompt bond hearing or to keep the person from being moved.

Court: U.S. District CourtFiling fee: $5
04

Government response and hearing

The court orders the government to respond, sometimes within days. The judge may decide on the papers or hold a hearing.

Timing: Set by the court
05

The order

If the court grants relief, it typically orders a bond hearing before an immigration judge, release on conditions, or another specific remedy. If it denies relief, we discuss next steps, including an appeal to the court of appeals.

Next: bond hearing, release, or appeal
Mandamus and APA

How a mandamus case moves

01

Check the delay and the history

Receipt notices, USCIS processing times, prior inquiries and the harm the delay is causing. There is no fixed number of months; a delay well beyond posted processing times, with inquiries on file, is the usual starting point.

Timing: Often 1–2 weeks to prepare
02

File the complaint

Usually in the federal district where the applicant lives, naming the agency and the officials responsible for the decision.

Court: U.S. District CourtFiling fee: $405
03

Serve the government

The U.S. Attorney’s Office is served and generally has 60 days to respond. In that time the agency often schedules the interview, issues a request for evidence, or decides the case.

Timing: 60 days to respond
04

Resolution

If the agency decides, the case is usually dismissed as moot. If it does not, the court weighs the TRAC factors: whether the agency follows a rule of reason, any timetable Congress set, whether health and welfare are at stake, the effect on the agency’s other priorities, and the interests harmed. Courts are reluctant to move one case ahead of others in the same line, so the reasons this delay is unreasonable must be shown with evidence.

Possible: decision, settlement, or court order

Documents to gather

  • For a detained person: full name, date and country of birth, and A-number
  • Where and when they were detained, and the facility they are in now
  • Any Notice to Appear, bond decision, removal order, and I-94 or entry record
  • Proof of ties here: lease, pay stubs, tax returns, children’s birth certificates, school and medical records
  • Court records for any arrest, even if dismissed
  • For a delayed case: every receipt, transfer and interview notice
  • Copies of all inquiries to USCIS, the Ombudsman or a congressional office, and the replies
  • Proof of harm from the delay: lost job offers, family separation, medical or travel needs

Common problems to avoid

  • Filing in the wrong district, or naming the wrong officials, which can delay a habeas case while the person stays detained.
  • Waiting to act after a detention. Transfers to distant facilities can happen quickly.
  • Filing a mandamus case on an application with unresolved problems, which may only speed up a denial.
  • Skipping the record of inquiries. Courts look for proof that the delay was raised with the agency.
  • Assuming a habeas case can stop a removal order. Challenges to removal orders follow different rules and deadlines.
  • Relying on notarios or online templates for federal court filings.
Recent developments

What has changed lately

As of Nov 2026

On October 1, 2026, the Supreme Court agreed to decide whether people who entered without inspection can be held for their whole removal case without a bond hearing (Rhoney v. Barbosa da Cunha, No. 26-104). Argument is expected in early 2027. Until the Court rules, the law of each circuit controls, so where a person is held can decide whether a habeas petition is likely to succeed.

As of Nov 2026

In the Ninth Circuit, which covers California and Arizona, Rodriguez Vazquez v. Bostock (July 30, 2026) holds that people in that situation are detained under 8 U.S.C. § 1226(a) and may seek bond. The Fifth and Eighth Circuits have sided with the government. Many habeas petitions in 2026 ask a district court to order the bond hearing that an immigration judge declined to hold.

Rules, fees and processing times change often. Ask us to confirm what applies to your case today.

Questions

Frequently asked questions

What is the difference between habeas corpus and mandamus?

Habeas corpus challenges whether a person’s detention is lawful. Mandamus, usually with an APA claim, asks a court to order an agency to make a decision it has unreasonably delayed. One is about custody; the other is about delay.

Will a habeas petition stop a deportation?

Not by itself. A habeas case reviews detention. Stopping a removal depends on other rules and on the stage of the immigration case, and federal district courts have limited power over removal orders.

How fast can a habeas petition be filed?

Once we have the person’s information and location, an emergency petition can sometimes be prepared within days. How quickly the court acts is up to the court.

How long must a case be pending before a mandamus lawsuit?

There is no fixed rule. Courts weigh the TRAC factors. A case far beyond the agency’s posted processing times, with documented inquiries and real harm, is a stronger candidate.

Can a mandamus lawsuit lead to a denial?

Yes. The court orders a decision, not an approval. That is why we review the application for problems before filing.

My naturalization interview was months ago. What can I do?

If USCIS has not decided the N-400 within 120 days after the interview, 8 U.S.C. § 1447(b) lets you ask the federal district court to decide the application or send it back to USCIS with instructions.

Can a lawsuit speed up an EB-5 petition?

Yes, an I-526 or I-526E petition delayed well beyond processing times can be the subject of a mandamus and APA case. See our EB-5 filings guide for the petitions themselves.

Do I have to live near your office?

No. The case is filed where the law requires, and much of the work can be done by video and phone. Our offices are in West Covina, City of Industry, Pasadena and Newport Beach.

Talk to the firm

Protect your rights, we’ll lead the fight.

守护您的权益,我们为您据理力争。

General information only, not legal advice. Contacting the firm does not create an attorney-client relationship. Prior results do not guarantee a similar outcome, and no particular result is promised. Responsible attorney: JJ Zhang, Esq., Tez Law P.C., 4141 S. Nogales St., Suite C102, West Covina, CA 91792.

Z
Zara TEZ Law P.C. • Online now
Z
Online now Chat with Zara