TRAVERSE CITY, Mich. — Dow Chemical Co. has agreed to fund environmental restoration projects worth an estimated $77 million to compensate for decades of pollution by its plant in Midland, Mich., officials said Friday.

A deal between the company and government agencies calls for improvements to fish and wildlife habitats tainted by dioxins and other hazardous substances from Dow’s manufacturing complex in its headquarters city of Midland.

The chemical giant also will pay for new public recreation areas with trails, fishing platforms and boating launches.

“This settlement has been more than a decade in the making by a combined team of state, federal and tribal partners working together for the benefit of Michigan’s environment and precious natural resources,” state Attorney General Dana Nessel said.

The agreement would be legally binding and needs a federal judge’s approval to take effect. It would resolve a complaint filed by government agencies that alleges the company’s pollution harmed birds, fish, invertebrates and mammals in the Tittabawassee and Saginaw Rivers and their watersheds.

Dow’s facility began operating in 1897. For generations it dumped or incinerated wastes that contaminated the 50-mile-long river valley, which extends into Lake Huron’s Saginaw Bay, with dioxins and related compounds linked to cancer and other illnesses.

Cleanup of the Tittabawassee River began in 2007 and is expected to be finished in 2021. No completion date has been set for the other waterways.

The pollution has prompted warnings to limit consumption of some fish and wild game and to avoid touching the soil in certain areas, including parks.

Under the agreement, Dow will pay for 13 natural resource projects in Midland, Saginaw and Bay Counties that will affect a combined 8,000 acres.

Construction of a fish passage ramp at a Tittabawassee River dam will provide hundreds of miles of new habitat for migratory species, while the state Department of Natural Resources will get funding to build spawning reefs in Saginaw Bay.

Other projects will protect and restore wetlands, farmlands and forests.

About 2,000 acres of private land will be shielded from development through conservation easements. An expansion of the Shiawassee National Wildlife Reserve will provide more room for hunting.

Biking and nature trails will be developed in preserved Tittabawassee flood plain areas habitat south of Midland.

As part of the settlement, Dow will pay $15 million to a team of trustees including officials with state and federal agencies and the Saginaw Chippewa Indian Tribe of Michigan.

Some of the money will be used to maintain and monitor the effectiveness of the 13 projects, while at least $5 million will fund additional natural resource initiatives selected by the trustees with advice from the public.

Dow also will reimburse government agencies for costs of studying how its pollution affected the environment.

In a statement, the company said it was “committed to working cooperatively with the … trustees to move forward with implementation of the proposed restoration plan over the next five years” and had set aside money to pay for the settlement.

The trustees will host a public meeting Nov. 21 in Saginaw to provide more details about the plan, said Matthew Schneider, U.S. attorney for the Eastern District of Michigan.

“We are thankful to Dow and the trustees for their work in reaching this excellent result, which will benefit the residents of the Saginaw Bay area and the wildlife and waterfowl that inhabit it,” Schneider said.