Karim Kadim, Associated Press
Guards stand at a cell block at the renovated Abu Ghraib prison, now renamed Baghdad Central Prison in Baghdad, Iraq, Saturday, Feb. 21, 2009.

SACRAMENTO, Calif. — Videos showing California prison guards using pepper spray on mentally ill inmates could be shown publicly for the first time Tuesday during opening statements of a federal court trial.

The videos are a central part of the latest chapter in a long-running legal case that has required the state to significantly improve its treatment of mentally ill inmates. Attorneys representing prisoners say the care remains inadequate.

Expert witnesses who viewed the videos said they show prison guards tossing chemical grenades and pumping pepper spray into the cells of mentally ill inmates, some of whom are seen screaming. In one case, an inmate was blasted with pepper spray five times within the span of a few minutes because he refused to leave his cell.

Gov. Jerry Brown's administration unsuccessfully sought to keep the videos from being shown in open court. U.S. District Court Judge Lawrence Karlton last week denied that request and ruled that the videos can be shown publicly.

According to the judge's order, the videos shown cannot be recorded and copies will not be made available to reporters or members of the public. The names of prison guards and inmates seen in the videos also must not be disclosed outside the courtroom.

Corrections department spokesman Jeffrey Callison said last week that if the videos are shown in open court, the state would want them to run in their entirety to provide proper context.

Michael Bien, an attorney for inmates suing the state, said each side will be allowed to play four hours of video during the trial in U.S. District Court in Sacramento.

This latest court battle comes after the Brown administration earlier this year asked to retake control of its prison mental health system from a court-appointed overseer. A judge rejected that request, and the pepper-spray videos were among a set of newly discovered problems.

The case and a separate lawsuit over general medical treatment of inmates have led federal judges to determine that the state must greatly reduce its prison population as the main way it can improve inmate care.