SEATTLE -

A tentative agreement has been reached between BNSF Railway and seven environmental groups that sued alleging coal spilled from trains pollutes waterways in Washington state.

Under the agreement announced Tuesday by both sides, BNSF agreed to conduct a two-year study on physical covers for coal and petroleum coke railcars. It also agreed to pay $1 million in environmental projects and clean up hotspots near waterways in Washington state.

Charlie Tebbutt, lead attorney for the plaintiffs, says the agreement puts BNSF on "a pathway to solving the problem and stopping the pollution."

BNSF denied any violations of the Clean Water Act and said in a statement Monday that the settlement reflects its long-term efforts to address coal dust.

The groups sued BNSF in 2013, arguing that it violated federal environmental law by allowing its trains to discharge coal and other pollutants into state rivers and waterways without a permit.

The agreement came on the sixth day of trial in federal court in Seattle.