For a while, the state board of education was threatening to take over the Boston Public Schiols, despite the fact that state takeovers have a dismal record. Then the state threatened to label the district “underperforming,” which served no purpose other than humiliation. But a deal was reached, and the state has backed off its heavy handed tactics.

Boston Mayor Michelle Wu and the state Education Commissioner Jeffrey Riley came to an eleventh hour agreement Monday to prevent the state from designating the district “underperforming” and stepping up oversight of the district.

The agreement between the state and city, announced Monday night, details district improvement efforts following a state review that found Boston Public Schools was failing to make enough progress in addressing long-standing problems, including providing services to English learners and students in special education.

“These commitments will set up the district for success right away,” said Wu in an interview Monday night. “I’m eager and ready for the work ahead.”

The deal comes after weeks of negotiationsand political brinksmanship that, at times, played out before the public. After the state in May released its audit outlining chronic dysfunction in Boston Public Schools, Wu pushed back on the state’s initial proposals to improve the district, which would have made her directly accountable to Riley for improving schools and imposed short deadlines for addressing problems. She instead called for a “partnership” with the state.

And when talks broke down last week, the state upped the ante by recommending Boston receive more oversight and be labeled underperforming, an embarrassing designation that can take years to reverse.

The negotiations have cast a feeling of uncertainty over the district, as it searches for a new superintendent. The Boston School Committee meets Wednesday to vote on two candidates: Mary Skipper, the Somerville superintendent; and Tommy Welch, a regional school superintendent in Boston Public Schools and BPS parent.

Welch has said he could begin Friday, after outgoing Superintendent Brenda Cassellius departs. Skipper has committed to staying in Somerville until the fall.

The agreement includes deadlines as early as August for the city and school system to complete many steps.

It’s hard to imagine any meaningful reforms that can be completed in the next six weeks.