FLINT, Mich. — The Flint City Council has narrowly approved a 30-year agreement to get drinking water from a regional agency after court-ordered negotiations.

The deal was approved Tuesday by a 5-4 vote after hours of debate and comments from dozens of residents.

The pact means the Great Lakes Water Authority will continue to serve Flint. It has been providing water for the Michigan city since fall 2015, when Gov. Rick Snyder acknowledged a lead crisis related to use of Flint River water.

Mayor Karen Weaver, who pushed for the deal, called it “a long time coming.” Critics say the agreement doesn’t sufficiently benefit residents.

Under the deal, a Flint representative will be appointed to the authority’s governing board. The city will also be relieved of debts owed to the Karegnondi Water Authority.