MONTGOMERY, Ala. (AP) — Olusegun Olatunji paid a $40,700 fine, did three months in a halfway house and spent a year on probation for selling counterfeit hats out of an Indianapolis shopping mall. Then, since the Nigerian native had overstayed a work visa 30 years ago, immigration officials detained him to await deportation in 2014.

More than three years later, he's still waiting. He's moved among six immigration detention centers, including his ongoing second stay at a county jail in northeastern Alabama that critics call a black hole for complicated deportation cases.

U.S. Immigration and Customs Enforcement agents detained more than 100,000 immigrants during the 2017 fiscal year, holding them an average of 34 days before releasing or deporting them, federal records show. Average length of detention was 22 days in fiscal year 2016.

But some are held for months or years because of pending appeals or delayed deportations — time that could increase after President Donald Trump's immigration crackdown and a recent ruling by the U.S. Supreme Court.

Many of the longest-running cases involve immigrants such as Olatunji who have been convicted of committing a nonimmigration crime but appeal their deportation. Olatunji, who like many in the system has no attorney, said he wants to stay to be able to support his 15-year-old U.S.-born son's college education.

"Until the last moment I'll be fighting for him. I told him I don't care how long it takes, until I've exhausted all the options," Olatunji said by phone last month from the Etowah County Detention Center in a contracted county jail in Gadsden, a facility that advocates have criticized as keeping detainees in poor conditions.

Immigrant advocates argue that detainees have rights equal to criminal defendants awaiting trial in jail, a notion that U.S. courts have generally rejected.

Unlike convicts serving out a defined sentence, however, "these folks are not knowing when their time will be up," said Donald Anthonyson, director of the national advocacy organization Families for Freedom and a former detainee.

In February, the U.S. Supreme Court threw out a lower-court decision that gave detained immigrants the right to a bond hearing after six months; most criminal defendants get such a hearing within days.

An earlier decision still lets detainees with deportation orders petition for release after three months if their deportation will be further delayed. The court said in that ruling the law "does not permit indefinite detention."

ICE declined a request for a phone interview quoting an official but said in an email to The Associated Press that the government can suspend the three-month time limit for deportation if the detainee fails to apply for travel documents or, according to immigration law, "conspires or acts to prevent" their deportation.

Etowah houses an average of 300 male immigrant detainees every day. A majority of them are long-term U.S. residents convicted of crimes who now face deportation.

Etowah has one of the highest national rates of transfers into the detention center and the longest time before the next transfer, according to federal data compiled by the Transactional Records Access Clearinghouse at Syracuse University. Federal records show Etowah had the second longest average length of stay — 101 days — of any detention center in the country in fiscal year 2017.

Phone surveys conducted by the national advocacy organization Freedom for Immigrants discovered that around one in six detainees have been detained at least six months. One man said he has been held nearly five and a half years.

Olatunji, who has been detained in Etowah twice, said the center is often the last stop for detainees like him.

"When they bring you here, they really want to deport you. In other places, it's more like a transit detention center," he said.

Nearly 700,000 cases are pending in immigration court, in part a legacy of ICE practices under President Barack Obama. Trump has ordered the Department of Homeland Security to further ramp up arrests and build more detention centers.

Olatunji argues that his case didn't have a fair hearing and that the government changed his charges, which prolonged his detention. An immigration judge ordered he doesn't qualify to petition for release since his deportation hasn't been finalized due to his pending appeals.

As Olatunji continues to appeal his deportation, there is no end in sight for his detention.