ANNAPOLIS, Md. — Maryland’s General Assembly has approved legislation that will require state-run psychiatric hospitals to more quickly accept patients who are supposed to be transferred out of local jails.

The Baltimore Sun reports that the legislation passed the Assembly Monday night and now goes to Gov. Larry Hogan.

The bill gives state-run hospitals 10 business days to accept court-ordered transfers from jails to hospitals. Hospitals that miss the deadline could face penalties, including a requirement to reimburse the jail for the cost of keeping the patient.

The legislation comes amid complaints that patients languish for weeks or even months in local jails even after judges find them to be mentally incompetent to stand trial.

Hospitals have said the delays stem from a lack of available beds.