Massachusetts lawmakers have approved a bill designed to improve dam safety.

The legislation would set aside $17 million for the repair or removal of unsafe, abandoned, or useless dams while also helping strengthen the state's coastal infrastructure.

The bill would also require the commissioner of conservation and recreation to issue a report on all dams across Massachusetts and require that emergency plans be drawn up for those dams deemed to be at a high or significant hazard to the public.

The bill would establish a loan program for dam repair and removal, and let cities and towns issue bonds to dismantle dams.

Environmental and engineering groups have been pushing for the bill, which supporters say will increase public safety while improving the health of rivers and wildlife.

The bill heads to Gov. Deval Patrick's desk. (Associated Press)