South Carolina signed a $75 million agreement with lawyers for state prisoners yesterday to end such practices as putting three inmates in a tiny cell and placing leg irons and handcuffs on vulnerable "protective-custody" inmates, lawyers for both sides said.

The agreement is the latest in a series of settlements with state prison systems around the country. In about 35 states, inhumane prison conditions have been remedied either as a result of such settlements or by court order.

Most of the $75 million settlement in the South Carolina case will be used to build new prisons, with the remainder targeted to improve conditions in older facilities, according to the agreement.

"We decided it was better to negotiate a settlement, and a lot less expensive," said William Leeke, commissioner of the Department of Corrections.

"If we defended the state prison system before the federal court and lost, the state would have lost its constitutionality and its sovereignty," he said.

The agreement stemmed from two years of negotiations following a class-action suit filed by a prisoner, according to Steven Ney of the National Prison Project of the American Civil Liberties Union, one of the three organizations that represented the prisoners. The lawsuit alleged that prison overcrowding fostered suicides, rapes, assaults and routine violence among inmates.

"Hopefully, the agreement will lead to significant changes in the way the prisons are run so they will be safer for guards and staff," Ney said. "And hopefully, prisoners will be provided with more activity and education so when they come out at least they're not any worse than when they came in."

Under the agreement, expected to be signed by a federal judge next month, South Carolina will shut down two prisons judged to have the worst conditions. Both are in Columbia, the state capital.

The agreement also includes provisions limiting the number of prisoners in a cell to two (rather than three), adding more physicians and psychologists, and allowing prisoners contact with visitors without plate glass separating them.

South Carolina imprisons a higher number of inmates per capita than most states, according to Ney. The state's population was 3.12 million in the 1980 census; it now has 8,500 inmates in 28 prisons designed to house 7,000, according to lawyers for the prisoners.

Compliance with the agreement will be monitored by a Department of Corrections official, with disputes to be mediated by Allen Breed, former director of the Justice Department's National Institute of Corrections.