At 18 years old, he was sentenced to 75 years.

In prison, he fought nearly every day with other inmates at the Ferguson Unit, in Midway, where he earned the nickname “Two-Gun” for his boxing skills. He was filled with rage, he said, and fought often with the guards, too, earning vicious reprisals. In 1985, he was placed in a segregated unit for unruly and dangerous prisoners, mostly gang members. “I was considered one of the bad boys,” he said.

In 1986, a white inmate tried to stab him, but wounded a guard instead. Mr. Green said the attacker, who belonged to a white supremacist gang, had wanted to kill him because he had allegedly raped a white woman.

Confined alone in a cell for all but two hours a day, he would ruminate endlessly about his trial, he said. “I lay back and thought over and over and over again, why did they find me guilty?” he said. In the late 1980s, he began to request books from the law library, looking for a way to overturn the conviction.

But he lost every appeal, and a public defender told him in 1988 that his case was hopeless, given the vehemence of the victim’s testimony. He saw no glimmer of hope until 2001, when Texas passed a statute granting inmates the right to request DNA tests on old evidence under certain conditions.

He wrote the motion himself on a typewriter in his cell and sent it to the trial judge in July 2005. The judge assigned a public defender to handle the request, but the motion languished for three years in a backlog of requests before the Harris County district attorney’s office.

Then in 2008, Patricia Lykos, a former judge and police officer, was elected district attorney, and one of her first acts was to reverse the office’s longstanding reluctance to admit mistakes. She assigned two assistant district attorneys and an investigator to do nothing but comb through about 185 cases involving requests for DNA tests as well as about 75 other innocence claims. So far, the unit’s work has led to the release of three men, including Mr. Green.