ALBANY — A cracked-up section of upstate highway is finally getting fixed, thanks to an agreement announced Wednesday between the Thruway Authority and Seneca Nation.

The 3-mile stretch of Interstate 90 that runs through sovereign lands near Buffalo went to pot as the state and Native American tribe fought a years-long battle over tolls, casino revenues and Seneca sovereignty.

“After a long five years, we are very pleased that the Nation finally agrees that this work must be completed as soon as possible,” the Thruway Authority’s executive director, Matt Driscoll, said in a press release.

“As promised, we have crews at the ready who will begin work tomorrow to focus on stabilizing and sustaining the roadway for all motorists as we head into the winter months.”

State officials said the construction will begin Thursday and could take up to 10 weeks.

“When the State engages the Nation in direct, respectful dialogue, we can make progress on issues of mutual interest, just as we have today and on other past projects,” Seneca President Rickey Armstrong added.

“Now that we have come to an agreement on the Thruway, I hope the State will show the same urgency in prioritizing and addressing the poor condition of other state roadways that impact people’s daily lives.”

The Senecas denied state repair crews access to I-90 for years as the tribe duked it out with state officials over money.

However, the tribe bowed Wednesday after newspapers exposed the road’s dangerous condition and state and local politicians demanded action — though the funding fight remains unresolved.

A Thruway Authority spokesman said costs have yet to be determined, but the money will come from toll revenue via the Thruway Authority’s Capital Program.