WASHINGTON — President Trump said on Twitter this weekend that undocumented immigrants were invaders who “must immediately, with no Judges or Court Cases,” be sent home. Mr. Trump’s comments prompted criticism that he wanted the United States to strip immigrants and asylum seekers of due-process rights. He also appeared to ignore the fact that some people who enter the country illegally are already removed from the United States without court hearings.

Here is what you need to know about how due process is applied in cases of illegal immigration:

What is due process?

Generally speaking, the Supreme Court says that due process allows people to exercise the legal rights and court processes afforded to them by American law, and it allows them to contest an action proposed by the government in front of a neutral decision maker, like a judge.

Do undocumented immigrants have a right to due process?

Yes. Courts have consistently held that anyone on United States soil is protected by the Constitution’s right to due process, even if they illegally entered the country, though people generally have greater legal protections inside the country than at the border.

How much process is deemed to be “due” depends on the situation. Courts have upheld that people who entered the United States illegally and were ordered deported have a right to appeal those decisions. But the courts have also essentially said that Congress can decide that more limited procedures are sufficient for noncitizens detained at the border.

What kind of due process do undocumented immigrants get?

Immigrants ordered to leave the country can fight deportation through civil proceedings involving immigration courts and judges overseen by the Justice Department. They can present testimony and evidence before an immigration judge, akin to a trial. They can be represented by a lawyer and can appeal unfavorable decisions to the Board of Immigration Appeals, an arm of the Justice Department.

Even if immigrants are ordered deported by the immigration appeals board, they can challenge those rulings again in front of a federal court. The process can take months or even years, especially because there is a significant backlog of such cases.

Can the government bypass that process?

Yes. A 1996 statute permits immigration authorities to deport people without a hearing, a lawyer or a right of appeal under certain conditions, a process known as expedited removal. Under current policy, the Department of Homeland Security criteria for expedited removals apply to undocumented migrants found within 100 miles of the border and within 14 days of entering the country. The statute imposes no geographic limit and allows for expedited removals up to two years after a migrant has entered the country, raising the possibility that the Trump administration may use this power more aggressively.

Can a new immigrant avoid expedited removal?

Yes, by seeking asylum. When that happens, officers at the United States Citizenship and Immigration Services — not a judge — will review cases to decide whether applicants have a credible fear of persecution back home. If so, they are placed in the immigration court system for a fuller consideration of their request. If officers decided that asylum seekers have no credible fear and should be deported, they still have a right to appeal that denial to an immigration judge, who has seven days to decide.

What about “zero tolerance” and criminal prosecution?

Further complicating matters, while asylum and deportation proceedings are a civil process, the government can also separately pursue criminal prosecution in regular federal court. Illegally entering the United States is a misdemeanor on the first offense and a felony for repeat offenders. In April, Attorney General Jeff Sessions announced a “zero tolerance” policy for such crimes.

How does this relate to family separation?

The systematic practice of handing adults to the custody of United States marshals for criminal prosecution separated families because their children cannot be held in custody and thus were considered unaccompanied. Immigration authorities then send the children to the Health and Human Services Department.

After Mr. Trump signed an executive order last week aimed at ending the separation of families by detaining parents and children together indefinitely, the Homeland Security Department stopped transferring adults with children to the marshals, creating a temporary reprieve.

What about “catch and release”?

Separate from its zero-tolerance policy of prosecuting all adults who enter the country illegally, the Trump administration has also sought to end so-called catch and release. Under that practice, adult migrants are paroled into the country while their lengthy asylum and deportation proceedings play out.

Ending catch and release is more complicated for families who are caught trying to illegally enter the United States together. Under a 2015 court ruling, the Department of Homeland Security may hold children for only 20 days before it must turn them over to the Department of Health and Human Services for temporary placement with a foster family or in a licensed child-care facility.

The Trump administration has asked a judge to rescind that ruling so that it can hold children in indefinite immigration detention, permitting immigration authorities to both keep adults detained and keep families together.

It is not clear whether the judge will grant the administration’s request, raising the possibility that family separations may resume in mid-July.

Adding to the confusion, it is not clear that the government has sufficient space to keep detaining all of the undocumented migrants apprehended near the border for now, although Mr. Trump has directed other agencies, including the Pentagon, to make space in their facilities.

A version of this article appears in print on , on Page A16 of the New York edition with the headline: Migrants to the U.S. Are Entitled to Due Process, With Some Exceptions. Order Reprints | Today’s Paper | Subscribe