SEATTLE (AP) — A federal judge has deemed unconstitutional Washington's practice of holding mentally ill people in jails while they await competency evaluations and treatment.

And during a trial that starts Monday, lawyers for mentally ill defendants and the state will try to find a remedy.

The trial comes as state lawmakers debate bills that seek to fix the problem ahead of a court ruling.

When judges think defendants are not mentally able to participate in their defense, they order competency evaluations and then treatment. But a shortage of beds at the state's psychiatric hospitals has forced many to wait in jails for weeks or months.

U.S. District Judge Marsha Pechman has ruled this practice violates their due-process rights. The trial aims to find solutions. It's expected to run about eight days.

More From News Talk KIT