SALT LAKE CITY — U.S. Department of Justice attorneys have dropped the appeal of a Utah federal judge's decision to grant an individualized bond hearing to a Salt Lake man who had been detained in the Utah County Jail for more than three years on an immigration hold while he fought deportation.

Martin Chairez-Castrejon, through his attorney, filed a writ in U.S. District Court in November 2015 asking the court to order that he be allowed to have a bond hearing.

U.S. District Judge Jill N. Parrish, after conducting a hearing in May, ordered an immigration judge to conduct the hearing.

In late June, Judge David Anderson held a half-day hearing and set Chairez's bond at $50,000. Chairez was released from the Utah County Jail on July 8 after his family posted bond.

Department of Justice attorneys later appealed Parrish's decision to grant the bond hearing. But according to recent 10th Circuit Court of Appeals records, they filed a motion to withdraw the appeal.

Chairez's attorney, Skyler Anderson, said the government's appeal of Parrish's decision was "in my opinion, it was a foolish move on their part.”

"In my view, it's such a slam-dunk case as far as showing the unreasonableness. They're trying to take an indefensible position that there's no limitation, that you can hold them forever without a bond hearing — as long as it takes them. So that's why I was surprised that they filed the appeal in the first place. Also I was confident it would result in a published decision that would be favorable to us," he said.

The Department of Justice, in its motion to dismiss the appeal, said "defendants have determined that appeal is no longer warranted. Defendants therefore wish to withdraw the instant appeal."

DOJ spokeswoman Nicole Navas said the department "declined to comment beyond" what was contained in the motion.

Prior to his release from jail, Chairez had been behind bars since early 2013, first to serve a 44-day criminal sentence after pleading no contest to felony discharge of a firearm during a fight in Salt Lake City the previous summer.

A DOJ attorney, in the May hearing before Parrish, said the length of the detention was due to multiple motions and appeals filed opposing Chairez's deportation.

Deportation proceedings were initiated after Chairez's criminal conviction for the gun offense.

Government attorneys have also appealed the immigration court's decision to grant bond to Chairez and Judge Anderson's determination that the government had the burden of proving Chairez's release would pose a danger to the community. Those matters are pending before the Board of Immigration Appeals.

Since his release from jail, Chairez has found a job and legally married his common law wife of more than two decades, according to his attorney. Chairez, who earned his GED while in jail, is also taking classes and volunteering, Skyler Anderson said.

As the matter was fought in immigration court, the Board of Immigration Appeals and federal court, Chairez was held at the Utah County Jail for more than three years at a cost of nearly $87,000, according to current reimbursement rates.

The jail has a contract to house detainees in the custody of Immigration and Customs Enforcement. Utah County officials recently announced that the jail would be ending its contract with ICE, primarily because of jail overcrowding, officials said.