PHILADELPHIA — The Justice Department cannot hold immigrants fighting deportation for years without bail hearings, a U.S. appeals court in Philadelphia ruled Thursday, echoing rulings in two other federal circuits.

It was unreasonable to detain a Pennsylvania man for nearly three years as he fought deportation to his native Senegal because of a 1995 drug case, the 3rd U.S. Circuit Court of Appeals panel ruled.

“We do not believe that Congress intended to authorize prolonged, unreasonable, detention without a bond hearing,” Judge Julio M. Fuentes of Newark, N.J., wrote for the three-judge panel’s unanimous decision.

The ruling grants other detainees held within the 3rd Circuit - which includes Pennsylvania, New Jersey and Delaware - the right to faster bail hearings.

The 9th Circuit, based in California, and the 6th Circuit, based in Kentucky, have issued similar rulings saying bail hearings must be held within a reasonable period of time, said Judy Rabinovitz, deputy director of the Immigrants’ Rights Project at the American Civil Liberties Union.

The ACLU, in support of plaintiff Cheikh Diop, argued in January that 500 to 1,000 of the 35,000 people then detained by the U.S. Department of Homeland Security had languished in custody for at least six months without bail hearings. The group believes their prolonged detention violates both the Immigration and Nationality Act and the detainees’ right to due process.

“We would hope that the government would use this as an opportunity to revisit the way it has been applying the mandatory detention statute … and adopt a reasonable implementation,” Ms. Rabinovitz said.

The ACLU had asked for a six-month limit for bail hearings, a deadline the Justice Department opposed.

On that point, the court sided with the government, saying each case must be weighed on its own merits.

“We decline to adopt such a one-size-fits-all approach. Reasonableness, by its very nature, is a fact-dependent inquiry requiring an assessment of all of the circumstances of any given case,” Judge Fuentes of Newark, N.J., wrote in the lengthy opinion.

Mr. Diop fled Senegal in 1990 amid torture and political persecution, his attorneys said. He settled in Wilkes-Barre, Pa., worked for years as a restaurant cook and had four American-born children. In 1995, he pleaded guilty to selling $100 worth of cocaine.

Twelve years later, he was detained because of the conviction and slated for deportation. He was held for 1,072 days at a U.S. detention center in York before he was granted bail.

Ms. Rabinovitz called such prolonged detentions both unconstitutional and costly - an average $60,000 a year per person.

“Why lock up people who don’t need to be locked up? If the bond hearing says a person is a danger or a flight risk, detain them,” she said Thursday.

Prosecutors, however, have said detainees such as Mr. Diop are often to blame for their prolonged detentions because they file numerous criminal appeals and other motions to avoid deportation.

Mr. Diop had his Luzerne County guilty plea overturned in November because the judge found he was not told of the deportation risk and did not enter his plea knowingly. The county prosecutor successfully appealed, but Mr. Diop may appeal yet again. Both his criminal and immigration cases are now likely to continue to crawl through various courts for years, Ms. Rabinovitz said.