Joseph Heard, the deaf, mute and mentally disabled man who was mistakenly held in the D.C. jail for nearly two years, will receive from $1.2 million to $1.5 million from the District and a private contractor to settle a three-year-old lawsuit under an agreement approved yesterday by a federal judge.

The District also agreed to pay reasonable attorney fees for the law firm Heard used, although that amount remains in dispute. The private contractor, which provided medical services at the jail and was responsible for monitoring Heard, agreed to pay $640,000.

Yesterday's hearing marked the final chapter in a case of wrongful imprisonment that shocked top city officials, inmate rights groups and advocates for the disabled when it came to light almost four years ago.

Heard was arrested in November 1998 on a misdemeanor charge of unlawful entry and ordered committed to St. Elizabeths Hospital several months later. After doctors found him mentally incompetent to stand trial, a D.C. Superior Court judge in October 1999 dismissed the charge and ordered him set free.

But he was taken to the jail instead because computer records erroneously showed that he had an outstanding charge in another case. Although a records officer at the jail later learned that this charge, too, had been dismissed, the paperwork authorizing Heard's release never arrived.

Heard, who had received a diagnosis of paranoid schizophrenia, stayed at the jail until Aug. 13, 2001, after jail officials reviewing the files of inmates in the mental health unit wondered why they could not locate his records.

During those 22 months, he received no visits from family members, friends or attorneys. He often scrawled the word "innocent" on scraps of paper and tried to communicate through another inmate that his jailing was a big mistake, but guards and mental health staff ignored his pleas, according to Heard and several witnesses who gave depositions in his lawsuit.

Heard, now 45, lives in Orlando with his sister, Sandy Hayes, who is a nurse. He did not attend the hearing, and his sister said he has chosen not to return to Washington, except when necessary for meetings with his attorneys, because of memories of his ordeal.

"I'm glad they finally came to a settlement," Hayes said yesterday in an interview. "Hopefully, this will improve his life and he'll forget about those two years they took from him."

His attorneys said they incurred $1 million in legal fees representing him in the lawsuit. The District contests the amount, and the court is expected to decide on an appropriate fee.

Heard's attorneys said their legal costs would have been much lower if the city had not caused the case to drag on. John Moustakas, one of the attorneys, said the city repeatedly refused to provide certain jail records and stalled in discussing a settlement amount.

"They locked him up illegally and unconstitutionally for two years," Moustakas said. "It's an obvious case of false imprisonment and violation of his civil rights. But still, the District fought us and played around with us for two years."

D.C. Attorney General Robert J. Spagnoletti said in a statement yesterday that he regrets what happened to Heard but that the city has a duty to protect its taxpayers.

"No amount of money can compensate a person for their loss of liberty for any period of time, especially the 22 months endured by Mr. Heard," Spagnoletti said.

"However, even in cases in which the District acknowledges its error at an earlier stage of the litigation, I must still defend against lawsuits and claims until a reasonable settlement demand is made that will fairly compensate the plaintiff and is in the best interests of the District of Columbia," he added.

A spokesman for Mayor Anthony A. Williams (D) said the mayor had nothing to add to Spagnoletti's statement.

The lawsuit alleged that the contractor providing health services at the jail at the time, the Center for Correctional Health and Policy Studies, violated Heard's civil rights by failing to provide him with a way to communicate with medical staff.

The center initially asked that the terms of its award be kept confidential but withdrew that request yesterday after consultation with the judge.

Heard's attorneys said the money he receives will be placed in a special-needs trust that will help him buy a house, pay utilities and provide him with a little spending money for fun and travel.

U.S. District Judge Colleen Kollar-Kotelly, who approved the settlement, said her primary concern was making sure the money would not fall into the hands of anyone trying to take advantage of Heard. At the same time, she said, she hoped some funds would reach him quickly so he could improve his life.

"I do want to make sure he's not back on the streets while this money should be on its way to him," she said.

Joseph Heard spent 22 months in the D.C. jail from 1999 to 2001.