He is an accident of history, a common criminal who became a celebrity in the longest prison lawsuit in American history, a twice-convicted felon who has spent at least two-thirds of his life behind bars. He has endured long stretches of solitary confinement, the harassment of prison guards and fellow inmates, self-mutilation and a phony charge of attempted homosexual rape.

Five months ago, he was on the brink of a new life, out of jail and back home to something of a hero's welcome. But today David Ruiz faces a chilling future: life in prison for a robbery he says he did not commit and a murder warrant in Ohio that reappeared after 14 years.

On Friday, lawyers from the Justice Department, the state of Texas and elsewhere will gather at the 5th U.S. Circuit Court of Appeals in New Orleans for oral arguments in the appeal of Ruiz, et al vs W. J. Estelle, et al, the massive lawsuit against the Texas prison system that resulted last year in a sweeping finding that the overcrowded prisons violate the constitutional rights of the inmates.

The case is one of the most significant prison reform suits in the country and eventually it may be left to the Supreme Court to define more fully what rights prisoners in America have. By then David Ruiz may be little more than a name on a document, but for a time both his future and that of the Texas prisons he is fighting against will be played out simultaneously. Ruiz is neither a hero nor a villain in this drama, only the central human character in a long struggle that has lasted a decade, cost millions of dollars and done unknown damage to the lives of thousands of people.

David Ruiz was born in Austin in 1942, one of 13 children of migrant parents. He was sent to reform school four times as a boy and was kept in custody until he was 17. Once out of jail, he got married and went to work painting houses with his father. A few months after his marriage, he went drinking with some friends, robbed a store and stole a car, and subsequently was sentenced to 12 years in prison. He was still 17.

This was Ruiz's first taste of life in the Texas prison system. He arrived, he said in a letter written to the archbishop of San Antonio two years ago, "with a head full of hate and bitterness." He got into fights with the convict-guards who kept watch on the prisoners, fought with other inmates, participated in a strike in the prison and spent much time in solitary confinement. After seven years he was released from prison and returned to Austin, where he began painting houses again with his father.

That year the family moved to California for a time, then returned to Austin in the fall. In the letter to Archbishop Patricio Flores, Ruiz said an assault warrant was issued for him in Austin in the fall of 1967. He then went to Toledo, Ohio, where he got into a barroom fight, he told the archbishop, and a murder warrant was issued for him. But he left Toledo and returned to Austin, and the murder warrant was apparently forgotten. Ruiz told the archbishop in the 1979 letter that he committed several robberies in Austin that fall, and in March, 1968, he was again convicted and sentenced to 25 years in prison. He was returned to the Texas prison system and "started where I left off."

In December, 1968, he escaped with four other inmates, but was captured several days later and put in solitary and segregation for 60 days. "Because of threats upon my life from certain prison officials, I mutilated myself . . . ," he wrote the archbishop. After being released from the hospital, he was transferred to another unit in the prison system, and soon his life began to change.

It was there that he met Frances Freeman Cruz, a lawyer who had become something of a den mother for jailhouse lawyers--or writ writers--in the Texas prisons. She helped Ruiz file papers seeking to overturn his robbery conviction, and, he said in the letter, turned his life away from violence toward prison reform. "I remember that he was a quiet, earnest young man," Cruz said in an interview. "I don't think he was the most skilled jailhouse lawyer, but he tried and he learned."

Ruiz learned enough to eventually file a complaint against prison conditions, ranging from inadequate medical care to the overcrowded cells to the brutality of the convict-guard system. His was one of several complaints later consolidated by U.S. District Judge William Wayne Justice into a single suit, carrying the name Ruiz vs. Estelle. In 1974, Judge Justice ordered the Justice Department to intervene in the case and four years later it went to trial, with testimony lasting one year.

Those were difficult years for Ruiz. "Those were days when things in the prisons were completely out of control," said William Turner, a California lawyer who argued the prisons case in behalf of the inmates. Prison officials saw Ruiz as a dangerous, violence-prone troublemaker. He spent long stretches in solitary confinement, was denied his "good time" for his actions, harassed by officials for his persistence in the lawsuit. "He's unbelievably tenacious, principled, almost in a religious sense immune to the things that people can do to him," Turner said.

Ruiz sat in the courtroom during the long prison trial, listening to testimony and often writing notes to his attorneys pointing out areas ripe for cross-examination. His voice barely rising above a whisper, he would lean over at crucial points to encourage his attorneys to probe particular points of testimony from prison officials. In December, 1980, Judge Justice ruled in harsh language that the prison conditions violated the inmates' constitutional rights, and later ordered sweeping changes in the administration of the system. Many of those remedies have been appealed by the state.

But the victory in the prisons case left Ruiz with other problems. Shortly after the trial had begun, Ruiz was hit with a new charge. Another inmate at the Harris County Jail near Houston, where Ruiz was housed during the trial, claimed that Ruiz had threatened him with rape. The charge was a last obstacle to freedom for Ruiz, who had by then served 12 years on a 25-year sentence.

Ruiz claimed the rape charge was phony, and last January, the other inmate recanted his testimony. He claimed he had been put up to the charge by unidentified jail officials, who he said promised him eventual freedom from a sentence for murder in return for his testimony against Ruiz. Three months later, Ruiz was granted parole, and in July he flew home to Austin with a promise to go straight.

Ruiz checked into a halfway house in the Mexican-American section of Austin, soon reconciled with his ex-wife and began working for a local community organization. He was in demand as a speaker, traveled to Detroit in October for a political conference and was almost invited to participate in the annual gridiron banquet put on by the statehouse press corps to do a takeoff of the American Express ad: "Hello, do you know me?"

Ruiz appeared to be making a smooth transition when on the night of Nov. 20, he was arrested at a home of his brother Bobby on suspicion of robbing a local grocery story on Oct. 25 and a local bar on Nov. 15. The next morning, David Ruiz was back on the front pages of Texas newspapers. Under a Texas law upheld by the Surpeme Court, any person convicted of a felony for the third time automatically receives a life sentence as a habitual offender.

On Nov. 30, Ruiz was indicted for the bar robbery. He claimed he was innocent, the victim of a frame-up by local officials and of the false testimony of a nephew also implicated in both robberies. He said he had alibis for both robberies and told a lawyer shorter after his arrest, "I'm not stupid enough to do this." He has been trying since then to get out of jail.

Last weekend, the case of David Ruiz took another fateful turn. The murder warrant in Toledo suddenly surfaced, after lying dormant for more than a decade. Prosecutors there say they want to try him on that charge after the robbery case in Austin has gone to trial. It is a reminder that David Ruiz's quest for a new life may be forever haunted by his past.