SAN JOSE — A mentally ill inmate doused with pepper spray and shot at an “impermissibly” close range with plastic bullets from a riot gun died as the result of medical neglect and excessive force, a lawsuit filed this week claims.

The suit, filed in federal court, seeks damages for the death two years ago of Walter Roches, 32.

Among other claims, Marina Roches contends that her son was shot four times with the riot gun by a deputy standing only 6 to 8 feet away — at least a foot closer than the manufacturer recommends.

The manufacturer also calls for the gun to be aimed only at a person’s thigh at close distances. However, the plastic projectiles struck Roches in his naked abdomen, leaving a huge bruise that measured 12 inches by 7.5 inches.

A spokesman for the sheriff’s office declined to comment Tuesday on the pending litigation.

But shortly after Roches’ death, Sheriff Laurie Smith banned jail guards and medical staff from using plastic bullets to subdue inmates, a practice that critics have said is excessive.

She also prohibited the use of chemical sprays in situations involving mentally ill or developmentally disabled inmates, unless the inmate has made an overt attempt to harm himself or others. And her directive required jail guards to call a mental health professional to the scene to speak to such inmates in all planned cell extractions or planned uses of force.

Cell extractions had long been criticized by Judge Stephen Manley, head of the Superior Court’s drug and mental health courts.

However, an autopsy concluded that Roches did not die from his injuries.

Roches was found dead in his cell on the fourth floor of the Main Jail in San Jose on Sept. 28, 2015, a week after guards extracted him from a cell using the spray and riot gun after he refused to leave to go to the psychiatric ward. However, at no time did Roches get physically or verbally aggressive, according to the lawsuit.

“After a week of pain and unconscionable misery, Walter had died alone in his urine-covered cell, forsaken by the people who had care, custody, and control of him,” the lawsuit prepared by lawyers Robert R. Powell and Sarah E. Marinho argued.

The report by Santa Clara County Medical Examiner Michelle Jorden found that Roches died of natural causes from sepsis — a severe blood infection that can lead to organ failure — from a chronic urinary tract illness, complicated by “exhaustive mania” after he refused to take medication he had been prescribed for schizophrenia and bipolar disorder.

High blood pressure and a history of stimulant drug use also contributed to his death, Dr. Jorden concluded.

Roches died nearly a month after another mentally ill man, Michael Tyree, was beaten to death by three jail guards. They were convicted of second-degree murder earlier this year. No correctional officers have been charged in Roches’ death.